ghost-portal/packages/page-settings/src/index.tsx
Jaco Greeff 33892a2e31
Nav re-imagined (#3422)
* Playthrough with top navigation

* Sycky, but navigation works...

* Adjust

* grouping

* It works, but is not great

* Cleanups

* Cleanups

* hover color

* Highlights

* Highlights, part 2

* Background to body

* Small adjustments (size, items)

* Localize Modal/route switching

* Remove light/full mode

* Flatter single-entry menus

* Adjustments for single-enrties (e.g. Kulupu)

* Display NodeInfo

* Misc

* Content & Tabs sizing

* Tab counters as bubbles

* Alignment

* Tabs styling

* Adjust font color to defaults

* Small tabs menu color adjustments

* ... the previous, again, adjusted

* Display Wiki/Github links

* ar motions

* Adjust Endpoints location

* Ensure content grows to available height

* Adjust tabs

* Menu background adjustment

* Adjust popup colors

* Adjust highlights

* Sligh breathing room

* Adaptive header background

* 2/3

* Adaptive is ok... for now.

* Back to black... erm, gray

* Lighten

* Touchups. Stop playin, it is ok...

* Sides readability

* Cleanups.

* Adjust.

* Overall adjustments (theme). Fix Tag yellow.

* Ok. Done.

* Ship it.
2020-08-20 17:50:30 +02:00

74 lines
1.9 KiB
TypeScript

// Copyright 2017-2020 @polkadot/app-settings authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { AppProps as Props } from '@polkadot/react-components/types';
import React, { useMemo } from 'react';
import { Route, Switch } from 'react-router';
import { HelpOverlay, Tabs } from '@polkadot/react-components';
import md from './md/basics.md';
import { useTranslation } from './translate';
import Developer from './Developer';
import I18n from './I18n';
import Metadata from './Metadata';
import General from './General';
import useCounter from './useCounter';
export { useCounter };
function SettingsApp ({ basePath, onStatusChange }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const numExtensions = useCounter();
const items = useMemo(() => [
{
isRoot: true,
name: 'general',
text: t<string>('General')
},
{
count: numExtensions,
name: 'metadata',
text: t<string>('Metadata')
},
{
name: 'developer',
text: t<string>('Developer')
},
{
name: 'i18n',
text: t<string>('Translate')
}
], [numExtensions, t]);
return (
<main className='settings--App'>
<HelpOverlay md={md as string} />
<header>
<Tabs
basePath={basePath}
items={items}
/>
</header>
<Switch>
<Route path={`${basePath}/developer`}>
<Developer
basePath={basePath}
onStatusChange={onStatusChange}
/>
</Route>
<Route path={`${basePath}/i18n`}>
<I18n />
</Route>
<Route path={`${basePath}/metadata`}>
<Metadata />
</Route>
<Route component={General} />
</Switch>
</main>
);
}
export default React.memo(SettingsApp);