Skip to content

Commit 20ad31a

Browse files
committed
feat: add fluent UI
1 parent 811dd49 commit 20ad31a

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

app/components/Home.tsx

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
import React, { useEffect, useState } from 'react';
22
import { Link } from 'react-router-dom';
3+
import {
4+
DefaultButton,
5+
PrimaryButton,
6+
Stack,
7+
IStackTokens,
8+
} from 'office-ui-fabric-react';
39
import routes from '../constants/routes.json';
4-
import styles from './Home.css';
10+
11+
export interface IButtonExampleProps {
12+
// These are set based on the toggles shown above the examples (not needed in real code)
13+
disabled?: boolean;
14+
checked?: boolean;
15+
}
16+
17+
// Example formatting
18+
const stackTokens: IStackTokens = { childrenGap: 40 };
519

620
export default function Home(): JSX.Element {
721
const [state] = useState<string>('Hi');
822

23+
const alertClicked = (): void => {
24+
alert('Clicked');
25+
};
26+
927
useEffect(() => {
1028
// axios
1129
// .get('http://localhost:5000')
@@ -14,8 +32,20 @@ export default function Home(): JSX.Element {
1432
}, []);
1533

1634
return (
17-
<div className={styles.container} data-tid="container">
35+
<div>
1836
<h2>{state}</h2>
37+
<Stack horizontal tokens={stackTokens}>
38+
<DefaultButton
39+
text="Standard"
40+
onClick={alertClicked}
41+
allowDisabledFocus
42+
/>
43+
<PrimaryButton
44+
text="Primary"
45+
onClick={alertClicked}
46+
allowDisabledFocus
47+
/>
48+
</Stack>
1949
<Link to={routes.COUNTER}>counter</Link>
2050
</div>
2151
);

app/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { Fragment } from 'react';
22
import { render } from 'react-dom';
33
import { AppContainer as ReactHotAppContainer } from 'react-hot-loader';
44
import { history, configuredStore } from './store';
5-
import './app.global.css';
65

76
const store = configuredStore();
87

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
"webpack-merge": "^5.0.9"
276276
},
277277
"dependencies": {
278+
"@fluentui/react": "^7.150.0",
278279
"@fortawesome/fontawesome-free": "^5.15.0",
279280
"@hot-loader/react-dom": "^16.13.0",
280281
"@reduxjs/toolkit": "^1.4.0",

0 commit comments

Comments
 (0)