From 12d53e8e6688fd9ffcf8d19c5282ed84e4f8f60f Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 29 Aug 2018 11:42:16 +0500 Subject: Componentize options form --- src/components/options-form/index.js | 29 ++++++++++++++++ src/components/options-form/styles.css | 48 ++++++++++++++++++++++++++ src/containers/options/index.js | 20 ++--------- src/containers/options/styles.css | 63 ++++------------------------------ 4 files changed, 86 insertions(+), 74 deletions(-) create mode 100644 src/components/options-form/index.js create mode 100644 src/components/options-form/styles.css (limited to 'src') diff --git a/src/components/options-form/index.js b/src/components/options-form/index.js new file mode 100644 index 0000000..393ab93 --- /dev/null +++ b/src/components/options-form/index.js @@ -0,0 +1,29 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; + +import './styles.css'; + +const OptionsForm = () => ( +
+
+

Add the Token

+

Generate a token and add it below to avoid hitting the rate limit.

+
+
    +
  • + Go to the Settings Personal Access Tokens of your github profile +
  • +
  • Click Generate New Token. Enter the description and select the scope called public_repo under repo and click Generate Token.
  • +
  • You will be presented with the generated token. Copy the token and add it below
  • +
+ +
+ + Go Home +
+); + +export default OptionsForm; diff --git a/src/components/options-form/styles.css b/src/components/options-form/styles.css new file mode 100644 index 0000000..f1b0e52 --- /dev/null +++ b/src/components/options-form/styles.css @@ -0,0 +1,48 @@ +.options-form ul { + padding: 0; + margin: 15px 0 15px 25px; +} + +.options-form ul li { + line-height: 30px; +} + +.options-form ul li span, +.options-form ul li a { + background: #ffa; + padding: 5px 7px; + color: #343a40; + border-radius: 8px; + font-size: 14px; + font-weight: 500; +} + +.options-form ul li a { + color: blue; + text-decoration: underline; +} + +.options-form .form-field p { + margin-bottom: 15px; +} + +.options-form .form-field input[type="text"] { + display: block; + box-shadow: none; + height: 60px; + -webkit-box-shadow: none; + border: 2px solid #ececec; + margin-bottom: 15px; +} + +.options-form .btn-save { + margin-bottom: 10px; +} + +.options-form .btn { + font-size: 15px; + padding: 15px 25px; + height: 60px; + display: block; + width: 100%; +} diff --git a/src/containers/options/index.js b/src/containers/options/index.js index 774aa31..d986f6e 100644 --- a/src/containers/options/index.js +++ b/src/containers/options/index.js @@ -3,6 +3,7 @@ import React from 'react'; import './styles.css'; import Logo from '../../components/icons/logo'; import { Link } from 'react-router-dom'; +import OptionsForm from '../../components/options-form'; class OptionsContainer extends React.Component { render() { @@ -20,24 +21,7 @@ class OptionsContainer extends React.Component {
-
-

Add the Token

-

Generate a token and add it below to avoid hitting the rate limit.

-
-
    -
  • - Go to the Settings Personal Access Tokens of your github profile -
  • -
  • Click Generate New Token. Enter the description and select the scope called public_repo under repo and click Generate Token.
  • -
  • You will be presented with the generated token. Copy the token and add it below
  • -
- -
- - Go Home +
); diff --git a/src/containers/options/styles.css b/src/containers/options/styles.css index 0cccdbd..c1b09e5 100644 --- a/src/containers/options/styles.css +++ b/src/containers/options/styles.css @@ -16,44 +16,6 @@ width: 85px; } -.options-container .header { - margin-bottom: 10px; -} - -.options-container .header h3 { - font-weight: 700; - margin-bottom: 0; -} - -.options-container .header .logo { - display: block; - margin-bottom: 10px; -} - -.options-container ul { - padding: 0; - margin: 15px 0 15px 25px; -} - -.options-container ul li { - line-height: 30px; -} - -.options-container ul li span, -.options-container ul li a { - background: #ffa; - padding: 5px 7px; - color: #343a40; - border-radius: 8px; - font-size: 14px; - font-weight: 500; -} - -.options-container ul li a { - color: blue; - text-decoration: underline; -} - .options-container .header .logo { color: #2d2d2d; } @@ -63,27 +25,16 @@ float: left; } -.options-container .form-field p { - margin-bottom: 15px; -} - -.options-container .form-field input[type="text"] { - display: block; - box-shadow: none; - height: 60px; - -webkit-box-shadow: none; - border: 2px solid #ececec; - margin-bottom: 15px; +.options-container .header { + margin-bottom: 10px; } -.options-container .btn-save { - margin-bottom: 10px; +.options-container .header h3 { + font-weight: 700; + margin-bottom: 0; } -.options-container .btn { - font-size: 15px; - padding: 15px 25px; - height: 60px; +.options-container .header .logo { display: block; - width: 100%; + margin-bottom: 10px; } -- cgit v1.3