forked from stake-house/wagyu-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WAGYU-38] System check page refactor (stake-house#67)
* update storybook config & mock certain modules * split up and refactor system check page * use new system check page * add devtools * fix minor styling issues * fix rocketpool loading flash issue * refactor installation status and remove render function
- Loading branch information
Showing
14 changed files
with
340 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
import { HashRouter } from 'react-router-dom'; | ||
|
||
export const withProviders = (storyFn: any) => { | ||
return <HashRouter>{storyFn()}</HashRouter>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const path = require('path'); | ||
|
||
/** | ||
* The doc doesn't really mention using webpack.config.js, but .storybook/main.js instead. | ||
* | ||
* Nevertheless, configuring the webpack.config.js seems to work fine. | ||
* | ||
* @param config | ||
* @param mode | ||
* @return {Promise<*>} | ||
* @see https://storybook.js.org/docs/react/configure/webpack | ||
* @see https://storybook.js.org/docs/react/configure/webpack#using-your-existing-config | ||
*/ | ||
module.exports = async ({ config, mode }) => { | ||
/** | ||
* Fixes npm packages that depend on `fs` module, etc. | ||
* | ||
* E.g: "winston" would fail to load without this, because it relies on fs, which isn't available during browser build. | ||
* | ||
* @see https://github.com/storybookjs/storybook/issues/4082#issuecomment-495370896 | ||
*/ | ||
config.node = { fs: 'empty', child_process: 'empty' }; | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { rem } from 'polished'; | ||
|
||
type Props = { | ||
isRocketPoolInstalled: boolean; | ||
}; | ||
|
||
const ResultsTableStyled = styled.table` | ||
border: ${rem(2)} solid gray; | ||
width: 75%; | ||
padding: ${rem(15)}; | ||
text-align: left; | ||
color: white; | ||
`; | ||
|
||
export const ResultsTable = ({ isRocketPoolInstalled }: Props) => { | ||
return ( | ||
<ResultsTableStyled> | ||
<thead> | ||
<tr> | ||
<th>Test</th> | ||
<th>Result</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td> | ||
Rocket Pool <i>not</i> installed | ||
</td> | ||
<td>{!isRocketPoolInstalled ? 'Pass' : 'Fail'}</td> | ||
</tr> | ||
</tbody> | ||
</ResultsTableStyled> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
|
||
import { SystemCheck } from './SystemCheck'; | ||
|
||
export default { | ||
title: 'Example/SystemCheckNew', | ||
component: SystemCheck, | ||
} as ComponentMeta<typeof SystemCheck>; | ||
|
||
const Template: ComponentStory<typeof SystemCheck> = () => { | ||
return <SystemCheck />; | ||
}; | ||
|
||
export const LoggedIn = Template.bind({}); |
Oops, something went wrong.