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

Commit

Permalink
Migrated to the latest @fluentui/react
Browse files Browse the repository at this point in the history
  • Loading branch information
FeodorFitsner committed Nov 30, 2020
1 parent ae6dce5 commit f13d7fe
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 66 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@fluentui/react": "^7.153.2",
"@reduxjs/toolkit": "^1.4.0",
"@types/http-proxy-middleware": "^0.19.3",
"@types/jest": "26.0.15",
Expand All @@ -14,7 +15,6 @@
"@types/reconnectingwebsocket": "^1.0.5",
"@uifabric/fluent-theme": "^7.3.46",
"http-proxy-middleware": "^1.0.6",
"office-ui-fabric-react": "^7.153.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
Expand Down
34 changes: 2 additions & 32 deletions client/src/App.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
.App {
/* .App {
text-align: center;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
} */
12 changes: 6 additions & 6 deletions client/src/FluentSample.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
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 { Text, Link, FontWeights, PrimaryButton, DefaultButton, TextField } from '@fluentui/react';
import { Stack, IStackProps, ProgressIndicator, Icon } from '@fluentui/react';
//import { SharedColors, FontSizes } from '@uifabric/fluent-theme';

const boldStyle = { root: { fontWeight: FontWeights.semibold } };
Expand Down Expand Up @@ -30,7 +28,9 @@ export const FluentSample: React.FunctionComponent = () => {
padding: '10px'
}
}}
gap={15}
tokens={
{ childrenGap: 15 }
}
>
<PrimaryButton text="Button 1" />
<Text variant="xxLarge">Hello, you!</Text>
Expand All @@ -55,7 +55,7 @@ export const FluentSample: React.FunctionComponent = () => {
<Stack {...columnProps}>
<TextField label="First name" />
<TextField label="Last name" />
<Stack horizontal gap="10">
<Stack horizontal tokens={{ childrenGap: 10 }}>
<ButtonType text="Button 2" />
<PrimaryButton text="Button 3" />
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion client/src/controls/Button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext } from 'react';
import { WebSocketContext } from '../WebSocket';
import { PrimaryButton, DefaultButton } from 'office-ui-fabric-react';
import { PrimaryButton, DefaultButton } from '@fluentui/react';

const button = React.memo(({control}) => {

Expand Down
2 changes: 1 addition & 1 deletion client/src/controls/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { shallowEqual, useSelector } from 'react-redux'
import ControlsList from './ControlsList'
import useTitle from '../hooks/useTitle'
import { Stack } from 'office-ui-fabric-react/lib/Stack';
import { Stack } from '@fluentui/react';

const Page = React.memo(({ control }) => {

Expand Down
2 changes: 1 addition & 1 deletion client/src/controls/PageLanding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useParams } from "react-router-dom";
import { useSelector } from 'react-redux';
import Page from './Page'
import { WebSocketContext } from '../WebSocket';
import { MessageBar, MessageBarType } from 'office-ui-fabric-react'
import { MessageBar, MessageBarType } from '@fluentui/react'

const PageLanding = () => {

Expand Down
2 changes: 1 addition & 1 deletion client/src/controls/Stack.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { shallowEqual, useSelector } from 'react-redux'
import ControlsList from './ControlsList'
import { Stack } from 'office-ui-fabric-react/lib/Stack';
import { Stack } from '@fluentui/react';

const MyStack = React.memo(({ control }) => {

Expand Down
2 changes: 1 addition & 1 deletion client/src/controls/Text.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Text } from 'office-ui-fabric-react/lib/Text';
import { Text } from '@fluentui/react';

const MyText = React.memo(({ control }) => {

Expand Down
2 changes: 1 addition & 1 deletion client/src/controls/Textbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useContext } from 'react';
import { WebSocketContext } from '../WebSocket';
import { useDispatch } from 'react-redux'
import { changeProps } from '../slices/pageSlice'
import { TextField } from 'office-ui-fabric-react';
import { TextField } from '@fluentui/react';
import { IControlProps } from './IControlProps'

export const Textbox = React.memo<IControlProps>(({control}) => {
Expand Down
14 changes: 0 additions & 14 deletions client/src/index.css

This file was deleted.

9 changes: 2 additions & 7 deletions client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { App } from './App';
import { FluentCustomizations } from '@uifabric/fluent-theme';
import { Customizer, mergeStyles } from 'office-ui-fabric-react';
import { mergeStyles } from '@fluentui/react';
import * as serviceWorker from './serviceWorker';
import { Provider } from 'react-redux'
import rootReducer from './rootReducer'
Expand All @@ -16,8 +15,6 @@ initializeIcons();
mergeStyles({
selectors: {
':global(body), :global(html), :global(#root)': {
margin: 0,
padding: 0,
height: '100vh'
}
}
Expand All @@ -28,13 +25,11 @@ const store = configureStore({
});

ReactDOM.render(
<Customizer {...FluentCustomizations}>
<Provider store={store}>
<WebSocketProvider>
<App />
</WebSocketProvider>
</Provider>
</Customizer>,
</Provider>,
document.getElementById('root')
);

Expand Down

0 comments on commit f13d7fe

Please sign in to comment.