Skip to content

Commit

Permalink
Fix pathing and linking
Browse files Browse the repository at this point in the history
  • Loading branch information
Studio384 committed Feb 14, 2024
1 parent 72fa62a commit 4e8e5e7
Show file tree
Hide file tree
Showing 10 changed files with 17,925 additions and 5,361 deletions.
57 changes: 26 additions & 31 deletions docs/src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,33 @@ import Icon from './app/Icon';
import Icons from './app/Icons';
import Layout from './design/layout/Layout';

const router = createHashRouter(
[
{
element: <Layout />,
errorElement: <Error />,
children: [
{
path: '/',
element: <Home />
},
{
path: '/icons',
element: <Icons />
},
{
path: '/icons/:slug',
element: <Icon />
},
{
path: '/docs',
element: <Docs />
},
{
path: '/docs/changelog',
element: <Changelog />
}
]
}
],
const router = createHashRouter([
{
basename: '/Amaranth'
element: <Layout />,
errorElement: <Error />,
children: [
{
path: '/',
element: <Home />
},
{
path: '/icons',
element: <Icons />
},
{
path: '/icons/:slug',
element: <Icon />
},
{
path: '/docs',
element: <Docs />
},
{
path: '/docs/changelog',
element: <Changelog />
}
]
}
);
]);

export default router;
5 changes: 4 additions & 1 deletion docs/src/app/Components/IconCard.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { NavLink } from 'react-router-dom';

import { Box, Link, Sheet, Stack, Typography } from '@mui/joy';

import { ILibraryIcon } from '@/types';
Expand Down Expand Up @@ -25,7 +27,8 @@ export default function IconCard({ icon }: { icon: ILibraryIcon }) {
</Box>
<Link
overlay
href={`/icons/${icon.slug}`}
component={NavLink}
to={`/icons/${icon.slug}`}
underline="none"
color="neutral"
sx={{
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/Docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import Header from '@/design/layout/LayoutElements/Header';

import DocsNavigation from './Docs/Navigation';
import PageBeat from './Docs/pages/Beat';
import PageFade from './Docs/pages/Fade';
import PageFlip from './Docs/pages/Flip';
import PageInstallation from './Docs/pages/Installation';
import PageRotate from './Docs/pages/Rotate';
import PageSpin from './Docs/pages/Spin';
import PageFade from './Docs/pages/Fade';

export default function Docs() {
return (
Expand Down
14 changes: 12 additions & 2 deletions docs/src/app/Docs/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { Fragment } from 'react';
import { NavLink } from 'react-router-dom';

import { List, ListItem, ListItemButton, ListItemContent, ListSubheader, Typography } from '@mui/joy';

import Amicon, { aiAmicons, aiArrowRotateRight, aiArrowsDownLeftRightUpCenter, aiCircleHalfInner, aiHeart, aiReact, aiSpinner, aiStar } from '@studio384/amaranth';
import Amicon, {
aiAmicons,
aiArrowRotateRight,
aiArrowsDownLeftRightUpCenter,
aiCircleHalfInner,
aiHeart,
aiReact,
aiSpinner,
aiStar
} from '@studio384/amaranth';

export default function DocsNavigation() {
const pages = [
Expand Down Expand Up @@ -82,7 +92,7 @@ export default function DocsNavigation() {
</ListSubheader>
{category.pages.map((page) => (
<ListItem key={page.link}>
<ListItemButton component="a" href={page.link} color="primary">
<ListItemButton component={NavLink} to={page.link} color="primary">
<ListItemContent>
<Typography noWrap>{page.title}</Typography>
</ListItemContent>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/Docs/pages/Beat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Code from '@/design/components/Code';

import { aiExpand, aiHeart, aiPlay } from '@studio384/amaranth';

import Playground, { IIconCssVariables, IPlaygroundConfig } from '../playground/Playground';
import ApiTable from '../playground/ApiTable';
import Playground, { IIconCssVariables, IPlaygroundConfig } from '../playground/Playground';

export default function PageBeat() {
const playgroundConfig: IPlaygroundConfig = {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/Docs/pages/Rotate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Code from '@/design/components/Code';

import { aiAmicons, aiArrowUp, aiMessageSmile } from '@studio384/amaranth';

import Playground, { IIconCssVariables, IPlaygroundConfig } from '../playground/Playground';
import ApiTable from '../playground/ApiTable';
import Playground, { IIconCssVariables, IPlaygroundConfig } from '../playground/Playground';

export default function PageRotate() {
const playgroundConfig: IPlaygroundConfig = {
Expand Down
1 change: 1 addition & 0 deletions docs/src/app/Docs/playground/ApiTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Sheet, Table } from '@mui/joy';

import Code from '@/design/components/Code';

import { IIconCssVariables } from './Playground';

interface IApiTableProps {
Expand Down
Loading

0 comments on commit 4e8e5e7

Please sign in to comment.