Skip to content

Commit

Permalink
Merge pull request #76 from sebgroup/develop
Browse files Browse the repository at this point in the history
Bug fixes and improvements
  • Loading branch information
yousifalraheem authored Oct 22, 2019
2 parents b2585c7 + cd27fab commit f8fc951
Show file tree
Hide file tree
Showing 32 changed files with 169 additions and 168 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ This project uses proper `ts-linting` and our lints are based on `tslint:latest`
1. Development: `npm start`
2. Check for Lint-ing rules, Compile components and Create Docs folder: `npm run build`
3. Build and create the Documentation pages only: `npm run docs`
4. To run the unit tests, run: `npm run test`
5. To run a unit test for a specific component you have to pass the name of the component in `comp` variable, run: `npm run test --comp=Button`
4. To run the unit tests, run: `npm test`
5. To run a unit test for a specific component you have to pass the name of the component in `comp` variable, run: `npm test Button`. It can also be chained with multiple specific components, e.g. `npm test Button RadioGroup`

## Usage

Expand Down
36 changes: 21 additions & 15 deletions develop/components/pages/ButtonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ const mysvg: JSX.Element = <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0

const ButtonPage: React.FunctionComponent = () => {
const themeList: Array<RadioListModel<ButtonTheme>> = [
{ group: "theme", label: "Primary", value: "primary" },
{ group: "theme", label: "Secondary", value: "secondary" },
{ group: "theme", label: "Alternative", value: "alternative" },
{ group: "theme", label: "Danger", value: "danger" },
{ group: "theme", label: "Ghost-dark", value: "ghost-dark" },
{ group: "theme", label: "Ghost-light", value: "ghost-light" },
{ group: "theme", label: "Anchor", value: "anchor" },
{ label: "Primary", value: "primary" },
{ label: "Secondary", value: "secondary" },
{ label: "Alternative", value: "alternative" },
{ label: "Danger", value: "danger" },
{ label: "Ghost-dark", value: "ghost-dark" },
{ label: "Ghost-light", value: "ghost-light" },
{ label: "Anchor", value: "anchor" },
];
const iconPositionList: Array<RadioListModel<ButtonIconPosition>> = [
{ group: "icon-position", label: "Right", value: "right" },
{ group: "icon-position", label: "Left", value: "left" },
{ label: "Right", value: "right" },
{ label: "Left", value: "left" },
];
const sizeList: Array<RadioListModel<ButtonSizes>> = [
{ group: "size", label: "Small", value: "sm" },
{ group: "size", label: "Medium", value: "md" },
{ group: "size", label: "Large", value: "lg" },
{ label: "Small", value: "sm" },
{ label: "Medium", value: "md" },
{ label: "Large", value: "lg" },
];
const [theme, setTheme] = React.useState<ButtonTheme>("primary");
const [iconPosition, setIconPosition] = React.useState<ButtonIconPosition>("right");
Expand Down Expand Up @@ -76,7 +76,13 @@ const ButtonPage: React.FunctionComponent = () => {
<div className="row">
<div className="col">
<p>Themes</p>
<RadioGroup list={themeList} value={theme} onChange={(e) => setTheme(e.currentTarget.value as ButtonTheme)} condensed />
<RadioGroup
name="theme"
list={themeList}
value={theme}
onChange={(e) => setTheme(e.currentTarget.value as ButtonTheme)}
condensed
/>
</div>
<div className="col">
<p>Options</p>
Expand All @@ -89,7 +95,7 @@ const ButtonPage: React.FunctionComponent = () => {
list={iconPositionList}
value={iconPosition}
condensed
name="icon"
name="icon-position"
onChange={(e) => setIconPosition(e.target.value as ButtonIconPosition)}
/>
}
Expand All @@ -100,7 +106,7 @@ const ButtonPage: React.FunctionComponent = () => {
list={sizeList}
value={size}
condensed
name="size"
name="icon-size"
onChange={(e) => setSize(e.target.value as ButtonSizes)}
/>
}
Expand Down
6 changes: 3 additions & 3 deletions develop/components/pages/RadioGroupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ const RadioGroupPage: React.FunctionComponent = () => {
};

const radioList: Array<RadioListModel> = [
{ value: "first", group: "my-group", label: "Radio 1", },
{ value: "second", group: "my-group", label: "Radio 2", description: "Some description" },
{ value: "third", group: "my-group", label: "Radio 3", description: "Disabled", disabled: true },
{ value: "first", label: "Radio 1", },
{ value: "second", label: "Radio 2", description: "Some description" },
{ value: "third", label: "Radio 3", description: "Disabled", disabled: true },
];

export default RadioGroupPage;
12 changes: 6 additions & 6 deletions docs/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/10.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/11.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/13.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/js/14.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/js/15.bundle.js

Large diffs are not rendered by default.

Loading

0 comments on commit f8fc951

Please sign in to comment.