{"id":1064,"date":"2017-10-12T12:00:41","date_gmt":"2017-10-12T03:00:41","guid":{"rendered":"https:\/\/blog.timecrowd.net\/?p=1064"},"modified":"2018-12-15T08:33:46","modified_gmt":"2018-12-14T23:33:46","slug":"electron-timecrowd-desktop-1","status":"publish","type":"post","link":"https:\/\/blog.timecrowd.net\/electron-timecrowd-desktop-1\/","title":{"rendered":"Electron\u3067TimeCrowd\u306e\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u3092\u52dd\u624b\u306b\u4f5c\u308b\uff08\u305d\u306e1\uff09"},"content":{"rendered":"<p><a href=\"https:\/\/blog.timecrowd.net\/image-differ\/\">\u524d\u56de<\/a>\u3001<a href=\"https:\/\/blog.timecrowd.net\/lambda-chatwork-bot\/\">\u524d\u3005\u56de<\/a>\u3068\u4f5c\u308b\u4f5c\u308b\u3068\u8a00\u3063\u3066\u7d50\u5c40\u4f5c\u3063\u3066\u3044\u306a\u304b\u3063\u305fTimeCrowd\u306e\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u3092\u3088\u3046\u3084\u304f\u4f5c\u308a\u59cb\u3081\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<div id=\"toc_container\" class=\"toc_white no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">1<\/span> \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/a><\/li><li><a href=\"#Bootstrap\"><span class=\"toc_number toc_depth_1\">2<\/span> Bootstrap\u306e\u5c0e\u5165<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">3<\/span> \u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u306e\u53d6\u5f97<\/a><\/li><li><a href=\"#TODO\"><span class=\"toc_number toc_depth_1\">4<\/span> \u4eca\u5f8c\u306eTODO<\/a><\/li><\/ul><\/div>\n<h2><span id=\"i\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/span><\/h2>\n<p>\u4eca\u56de\u306e\u30a2\u30d7\u30ea\u306f\u6700\u7d42\u7684\u306b\u305d\u308c\u306a\u308a\u306e\u898f\u6a21\u306b\u306a\u308a\u305d\u3046\u306a\u306e\u3067React\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u30dc\u30a4\u30e9\u30fc\u30d7\u30ec\u30fc\u30c8\u306b\u306f\u4ee5\u4e0b\u3092\u5229\u7528\u3055\u305b\u3066\u3082\u3089\u3044\u307e\u3059\u3002<br \/>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"no_icon\" href=\"https:\/\/github.com\/chentsulin\/electron-react-boilerplate\" target=\"_blank\"><div class=\"lkc-card\"><div class=\"lkc-content\"><span class=\"lkc-thumbnail\"><img class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/https%3A%2F%2Fgithub.com%2Fchentsulin%2Felectron-react-boilerplate?w=100\" alt=\"\" \/><\/span><span class=\"lkc-title\">chentsulin\/electron-react-boilerplate<\/span><div class=\"lkc-url\"><cite>https:\/\/github.com\/chentsulin\/electron-react-boilerplate<\/cite><\/div><div class=\"lkc-excerpt\">electron-react-boilerplate - Live editing development on desktop app<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div><\/p>\n<p>\u50d5\u500b\u4eba\u306bTimeCrowd\u3068\u3044\u3046\u540d\u524d\u3092\u4f7f\u3046\u6a29\u5229\u306f\u3042\u308a\u307e\u305b\u3093\u306e\u3067\u3001tcmac\u3068\u3044\u3046\u307c\u304b\u3057\u305f\u540d\u524d\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$ git clone --depth=1 https:\/\/github.com\/chentsulin\/electron-react-boilerplate.git\r\n$ tcmac\r\n$ cd tcmac\r\n$ yarn\r\n$ npm run dev\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067\u30e2\u30c0\u30f3\u306a\u958b\u767a\u74b0\u5883\u306e\u6574\u3063\u305f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u304c\u52d5\u304d\u307e\u3059\u3002\u3044\u3044\u6642\u4ee3\u3067\u3059\u306d\uff01<\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30db\u3099\u30a4\u30e9\u30fc\u30d5\u309a\u30ec\u30fc\u30c8.png\" alt=\"\u30db\u3099\u30a4\u30e9\u30fc\u30d5\u309a\u30ec\u30fc\u30c8\" width=\"1136\" height=\"840\" class=\"alignnone size-full wp-image-1081\" srcset=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30db\u3099\u30a4\u30e9\u30fc\u30d5\u309a\u30ec\u30fc\u30c8.png 1136w, https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30db\u3099\u30a4\u30e9\u30fc\u30d5\u309a\u30ec\u30fc\u30c8-768x568.png 768w\" sizes=\"(max-width: 1136px) 100vw, 1136px\" \/><\/p>\n<h2><span id=\"Bootstrap\">Bootstrap\u306e\u5c0e\u5165<\/span><\/h2>\n<p>CSS\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u306f\u307f\u3093\u306a\u5927\u597d\u304d\u3001Bootstrap\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>yarn\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$ yarn add bootstrap@4.0.0-beta\r\n<\/code><\/pre>\n<p><code>app\/app.global.css<\/code>\u3067\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<pre><code>@import \"~bootstrap\/dist\/css\/bootstrap.css\";\r\n<\/code><\/pre>\n<p>\u3042\u3068\u306fJSX\u3084\u30b9\u30bf\u30a4\u30eb\u3092\u4fee\u6b63\u3059\u308c\u3070\u3044\u3064\u3082\u306eBootstrap\u306a\u898b\u305f\u76ee\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30db\u30fc\u30e0.png\" alt=\"\u30db\u30fc\u30e0\" width=\"1136\" height=\"840\" class=\"alignnone size-full wp-image-1079\" srcset=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30db\u30fc\u30e0.png 1136w, https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30db\u30fc\u30e0-768x568.png 768w\" sizes=\"(max-width: 1136px) 100vw, 1136px\" \/><\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30bf\u3099\u30c3\u30b7\u30e5\u30db\u3099\u30fc\u30c8\u3099.png\" alt=\"\u30bf\u3099\u30c3\u30b7\u30e5\u30db\u3099\u30fc\u30c8\u3099\" width=\"1136\" height=\"840\" class=\"alignnone size-full wp-image-1080\" srcset=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30bf\u3099\u30c3\u30b7\u30e5\u30db\u3099\u30fc\u30c8\u3099.png 1136w, https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30bf\u3099\u30c3\u30b7\u30e5\u30db\u3099\u30fc\u30c8\u3099-768x568.png 768w\" sizes=\"(max-width: 1136px) 100vw, 1136px\" \/><\/p>\n<h2><span id=\"i-2\">\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u306e\u53d6\u5f97<\/span><\/h2>\n<p>\u30dc\u30a4\u30e9\u30fc\u30d7\u30ec\u30fc\u30c8\u306b\u5143\u3005\u3042\u3063\u305fCounter\u7528\u306eAction, Reducer\u3092User\u306b\u66f8\u304d\u63db\u3048\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u53d6\u5f97\u30fb\u4fdd\u6301\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<br \/>\n\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u306f\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u3067\u5165\u529b\u3057\u305f\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u4f7f\u3063\u3066<a href=\"https:\/\/timecrowd.net\/apidoc\" rel=\"noopener\" target=\"_blank\">API<\/a>\u304b\u3089\u53d6\u5f97\u3057\u3001\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3067\u306f\u6240\u5c5e\u3059\u308b\u30c1\u30fc\u30e0\u4e00\u89a7\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5909\u66f4\u5f8c\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>\/\/ @flow\r\n\r\nimport type { userStateType, userActionType } from &#039;..\/reducers\/user&#039;;\r\nimport API from &#039;..\/utils\/api&#039;;\r\n\r\nexport const SET_USER = &#039;SET_USER&#039;;\r\n\r\nexport function setUser(user: userStateType) {\r\n  return {\r\n    type: SET_USER,\r\n    payload: user,\r\n  };\r\n}\r\n\r\nexport function fetchUser(token: string) {\r\n  return (dispatch: (action: userActionType) => void) => {\r\n    API.request(token, &#039;user\/info&#039;, &#039;GET&#039;).then(({ id, nickname, teams }) => {\r\n      dispatch(setUser({ id, nickname, teams }));\r\n    });\r\n  };\r\n}\r\n<\/code><\/pre>\n<p>\u307e\u305f\u3001API\u306f\u547c\u3073\u51fa\u3057\u306f\u3053\u306e\u3088\u3046\u306a\u7c21\u6613\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3067\u51e6\u7406\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>\/\/ @flow\r\n\r\nconst buildHeaders = (token: ?string) => {\r\n  const headers = {\r\n    Accept: &#039;application\/json&#039;,\r\n    &#039;Content-Type&#039;: &#039;application\/json&#039;,\r\n  };\r\n  if (token) {\r\n    headers[&#039;Authorization&#039;] = `Bearer ${token}`;\r\n  }\r\n  return headers;\r\n}\r\n\r\nconst request = (token: ?string, path: string, method: string, body: ?string) => (\r\n  fetch(`https:\/\/timecrowd.net\/api\/v1\/${path}`, {\r\n    method: method,\r\n    headers: buildHeaders(token),\r\n    body: body ? JSON.stringify(body) : null,\r\n  })\r\n  .then(response => response.json())\r\n);\r\n\r\nexport default {\r\n  request,\r\n};\r\n<\/code><\/pre>\n<p>\u3053\u306e\u72b6\u614b\u3067\u5b9f\u969b\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u308b\u3068\u3001\u6b63\u5e38\u306b\u52d5\u3044\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30b5\u30a4\u30f3\u30a4\u30f3.png\" alt=\"\u30b5\u30a4\u30f3\u30a4\u30f3\" width=\"1136\" height=\"840\" class=\"alignnone size-full wp-image-1077\" srcset=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30b5\u30a4\u30f3\u30a4\u30f3.png 1136w, https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30b5\u30a4\u30f3\u30a4\u30f3-768x568.png 768w\" sizes=\"(max-width: 1136px) 100vw, 1136px\" \/><\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30c1\u30fc\u30e0\u4e00\u89a7.png\" alt=\"\u30c1\u30fc\u30e0\u4e00\u89a7\" width=\"1136\" height=\"840\" class=\"alignnone size-full wp-image-1078\" srcset=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30c1\u30fc\u30e0\u4e00\u89a7.png 1136w, https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2017\/10\/\u30c1\u30fc\u30e0\u4e00\u89a7-768x568.png 768w\" sizes=\"(max-width: 1136px) 100vw, 1136px\" \/><\/p>\n<p>\u307e\u3060\u3044\u308d\u3044\u308d\u3068\u8abf\u6574\u304c\u5fc5\u8981\u3067\u3059\u304c\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"no_icon\" href=\"https:\/\/github.com\/tnantoka\/tcmac\" target=\"_blank\"><div class=\"lkc-card\"><div class=\"lkc-content\"><span class=\"lkc-thumbnail\"><img class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/https%3A%2F%2Fgithub.com%2Ftnantoka%2Ftcmac?w=100\" alt=\"\" \/><\/span><span class=\"lkc-title\">tnantoka\/tcmac<\/span><div class=\"lkc-url\"><cite>https:\/\/github.com\/tnantoka\/tcmac<\/cite><\/div><div class=\"lkc-excerpt\">Contribute to tcmac development by creating an account on GitHub.<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<h2><span id=\"TODO\">\u4eca\u5f8c\u306eTODO<\/span><\/h2>\n<p>\u571f\u53f0\u306f\u3067\u304d\u305f\u306e\u3067\u3001\u30d6\u30ed\u30b0\u30cd\u30bf\u304c\u5207\u308c\u305f\u6642\u306b\u307e\u305f\u9032\u3081\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u76f4\u8fd1\u306eTODO\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6700\u8fd1\u306e\u4f5c\u696d\u5c65\u6b74\u3092\u8868\u793a<\/li>\n<li>\u8868\u793a\u3057\u305f\u30bf\u30b9\u30af\u304b\u3089\u6253\u523b<\/li>\n<li>\u7a3c\u50cd\u4e2d\u306e\u30bf\u30b9\u30af\u8868\u793a<\/li>\n<li>\u30c6\u30b9\u30c8\u3092\u4fee\u6b63\u3059\u308b<\/li>\n<li>Flow\u3092\u3061\u3083\u3093\u3068\u52c9\u5f37\u3059\u308b<\/li>\n<\/ul>\n<p>\u4eca\u56de\u306f\u4ee5\u4e0a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u524d\u56de\u3001\u524d\u3005\u56de\u3068\u4f5c\u308b\u4f5c\u308b\u3068\u8a00\u3063\u3066\u7d50\u5c40\u4f5c\u3063\u3066\u3044\u306a\u304b\u3063\u305fTimeCrowd\u306e\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u3092\u3088\u3046\u3084\u304f\u4f5c\u308a\u59cb\u3081\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u76ee\u6b211 \u30d7\u30ed\u30b8\u30a7&#8230;","protected":false},"author":4,"featured_media":1088,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":""},"categories":[1],"tags":[12],"_links":{"self":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts\/1064"}],"collection":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/comments?post=1064"}],"version-history":[{"count":13,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts\/1064\/revisions"}],"predecessor-version":[{"id":3908,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts\/1064\/revisions\/3908"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/media\/1088"}],"wp:attachment":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/media?parent=1064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/categories?post=1064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/tags?post=1064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}