aboutsummaryrefslogtreecommitdiff
path: root/src/settings/components/form/PropertiesForm.tsx
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-09-22 11:03:07 +0900
committerGitHub <noreply@github.com>2020-09-22 11:03:07 +0900
commitd956b9e976c01db3944643e2260cb23e23b08221 (patch)
treed953d4d629bd31f5ba1b248133ee1f77cdf470ac /src/settings/components/form/PropertiesForm.tsx
parent5d82441ce3d12301bb8f04b78b79fffb04121a37 (diff)
parent7257406df196a29c0f172ee68ca8dbe50a72d21f (diff)
Merge pull request #838 from ueokande/form-styled-components
Use styled-components instead of vanilla CSS/SCSS in option
Diffstat (limited to 'src/settings/components/form/PropertiesForm.tsx')
-rw-r--r--src/settings/components/form/PropertiesForm.tsx33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/settings/components/form/PropertiesForm.tsx b/src/settings/components/form/PropertiesForm.tsx
index aebd9b1..53ebf03 100644
--- a/src/settings/components/form/PropertiesForm.tsx
+++ b/src/settings/components/form/PropertiesForm.tsx
@@ -1,6 +1,20 @@
-import "./PropertiesForm.scss";
+import styled from "styled-components";
import React from "react";
+const Form = styled.div``;
+
+const Row = styled.div``;
+
+const Label = styled.label`
+ display: inline-block;
+ min-width: 5rem;
+ font-weight: bold;
+`;
+
+const Input = styled.input`
+ line-height: 2.2rem;
+`;
+
interface Props {
types: { [key: string]: string };
value: { [key: string]: any };
@@ -21,7 +35,7 @@ class PropertiesForm extends React.Component<Props> {
const values = this.props.value;
return (
- <div className="form-properties-form">
+ <Form>
{Object.keys(types).map((name) => {
const type = types[name];
let inputType = "";
@@ -42,23 +56,22 @@ class PropertiesForm extends React.Component<Props> {
return null;
}
return (
- <div key={name} className="form-properties-form-row">
- <label>
- <span className="column-name">{name}</span>
- <input
+ <Row key={name}>
+ <Label>
+ <span>{name}</span>
+ <Input
type={inputType}
name={name}
- className="column-input"
value={values[name] ? values[name] : ""}
onChange={onChange}
onBlur={this.props.onBlur}
checked={values[name]}
/>
- </label>
- </div>
+ </Label>
+ </Row>
);
})}
- </div>
+ </Form>
);
}