Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
Fluent UI example extended
Browse files Browse the repository at this point in the history
  • Loading branch information
FeodorFitsner committed Nov 26, 2020
1 parent 145ffd5 commit 48fcca8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
28 changes: 19 additions & 9 deletions client/src/FluentSample.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import React from 'react';
import { Text, Link, FontWeights, PrimaryButton, TextField } from 'office-ui-fabric-react';
import { Stack, IStackProps, IStackStyles } from 'office-ui-fabric-react/lib/Stack';
import { Text, Link, FontWeights, PrimaryButton, DefaultButton, TextField } from 'office-ui-fabric-react';
import { Stack, IStackProps } from 'office-ui-fabric-react/lib/Stack';
import { Icon } from 'office-ui-fabric-react/lib/Icon';
import { ProgressIndicator } from 'office-ui-fabric-react/lib/ProgressIndicator';
//import { SharedColors, FontSizes } from '@uifabric/fluent-theme';

const boldStyle = { root: { fontWeight: FontWeights.semibold } };

const stackTokens = { childrenGap: 50 };
const stackStyles: Partial<IStackStyles> = { root: { width: 800 } };
const MyIcon = () => <Icon iconName="CompassNW" styles={{ root: { fontSize: '36px'}}} />;

// const stackTokens = { childrenGap: 50 };
// const stackStyles: Partial<IStackStyles> = { root: { width: 800 } };
const columnProps: Partial<IStackProps> = {
tokens: { childrenGap: 15 },
styles: { root: { width: "50%" } },
};

const ButtonType = DefaultButton;

export const FluentSample: React.FunctionComponent = () => {
return (
<Stack
horizontal
horizontalAlign="center"
verticalAlign="center"
verticalFill
Expand All @@ -26,7 +32,8 @@ export const FluentSample: React.FunctionComponent = () => {
}}
gap={15}
>
<Stack horizontal styles={{ root: { width: '100%'}}}>
<Text variant="xxLarge">Hello, you!</Text>
<Stack horizontal styles={{ root: { width: '50%' } }}>
<Stack {...columnProps}>
<Link href="https://developer.microsoft.com/en-us/fabric">Docs</Link>
<Link href="https://stackoverflow.com/questions/tagged/office-ui-fabric">Stack Overflow</Link>
Expand All @@ -38,21 +45,24 @@ export const FluentSample: React.FunctionComponent = () => {
/> */}
<Text variant="xxLarge" styles={boldStyle}>
Welcome to Your UI Fabric App
</Text>
</Text>
<Text variant="large">For a guide on how to customize this project, check out the UI Fabric documentation.</Text>
<Text variant="large" styles={boldStyle}>
Essential Links
</Text>
</Text>
</Stack>
<Stack {...columnProps}>
<TextField label="First name" />
<TextField label="Last name" />
<Stack horizontal gap="10">
<PrimaryButton text="Button 2" />
<ButtonType text="Button 2" />
<PrimaryButton text="Button 3" />
</Stack>
</Stack>
</Stack>
<Text block variant="xSmall" styles={{ root: { textAlign: "left", width: "50%" } }}>Copyright &copy; 2020</Text>
<MyIcon/>
<ProgressIndicator label="Example title" description="Example description" percentComplete={0.5} styles={{ root: { width: "50%" } }} />
</Stack>
);
};
3 changes: 3 additions & 0 deletions client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { Provider } from 'react-redux'
import rootReducer from './rootReducer'
import { configureStore } from '@reduxjs/toolkit'
import { WebSocketProvider } from './WebSocket';
import { initializeIcons } from '@uifabric/icons';

initializeIcons();

// Inject some global styles
mergeStyles({
Expand Down

0 comments on commit 48fcca8

Please sign in to comment.