Files
Mark Sinclair c66d7ed489 Update Network Explorer Packages and add mix node identity key copy (#1142)
* Use new eslint rules and apply fixes. Use new logo component and shared theme + webpack config.

* Add shared component to display a copy icon and copy to clipboard with confirmation state

* Organise imports

* Add copy mixnode identity key to list of mixnodes and detail view

* Update nvm node version to 16

* Update GitHub Actions for Network Explorer to use yarn and yarn workspaces

* Switch favicon for smaller N icon

* Update README

* Add error boundary
2022-03-09 19:08:21 +00:00
..
2022-03-08 10:50:41 +00:00

Nym MUI Theme

This package provides an extension to the MUI theme system to use Nym branding.

If you are unfamiliar with Material UI theming, please read the following first:

Add theme typings to your project

This package also provides a template file to add typings to the theme using Typescript's module augmentation.

Read the following if you are unfamiliar with module augmentation and declaration merging. Then look at the recommendations from Material UI docs for implementation:

Example usage

You can see an example of how to use this theme in react-webpack-with-theme-example:

export const App: React.FC = () => (
  <AppContextProvider>
    <AppTheme>
      <Content />
    </AppTheme>
  </AppContextProvider>
);

export const AppTheme: React.FC = ({ children }) => {
  const { mode } = useAppContext();

  return <NymThemeProvider mode={mode}>{children}</NymThemeProvider>;
};

export const Content: React.FC = () => {
  ...
  <Typography sx={{ color: (theme) => theme.palette.nym.networkExplorer.mixnodes.status.active }}>
    The quick brown fox jumps over the white fence
  </Typography>
  ...
}

Development

The best way to make changes to the theme is to:

  1. Run this package in watch mode with yarn watch
  2. Run Storybook from react-components with yarn storybook
  3. Make sure the component you are changing is included in the playground
  4. Watch for changes in the Playground story

Also remember to check light mode and dark mode!

Building

This package should be built from the root of the repository as follows:

yarn
yarn build

Publishing

This package is not published to NPM ... yet.