Skip to content

Commit

Permalink
refactor(Icons): Replace legacy Graph, House and Tools icons
Browse files Browse the repository at this point in the history
  • Loading branch information
m7kvqbe1 committed Jan 24, 2022
1 parent ef0b66a commit d4bffdc
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 64 deletions.
1 change: 1 addition & 0 deletions packages/css-framework/src/components/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ body.has-sidebar {
align-items: center;
justify-content: center;
width: $bar-width - $border;
color: f.color('neutral', '200');
}

.rn-iconfill {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { ComponentStory, ComponentMeta } from '@storybook/react'
import { IconHome, IconBarChart, IconTune } from '@defencedigital/icon-library'

import { Graph, House, Tools } from '../../../icons'
import { Link } from '../../Link'
import { Notification, Notifications } from '../NotificationPanel'
import { Sidebar, SidebarNav, SidebarNavItem, SidebarUser } from './index'
Expand Down Expand Up @@ -31,13 +31,13 @@ export default {
export const Default: ComponentStory<typeof Sidebar> = (props) => {
const nav = (
<SidebarNav>
<SidebarNavItem Image={House} link={<Link href="#">Home</Link>} />
<SidebarNavItem Image={IconHome} link={<Link href="#">Home</Link>} />
<SidebarNavItem
Image={Graph}
Image={IconBarChart}
link={<Link href="#">Stats</Link>}
isActive
/>
<SidebarNavItem Image={Tools} link={<Link href="#">Tools</Link>} />
<SidebarNavItem Image={IconTune} link={<Link href="#">Settings</Link>} />
</SidebarNav>
)

Expand All @@ -51,13 +51,13 @@ export const WithUser: ComponentStory<typeof Sidebar> = (props) => {

const nav = (
<SidebarNav>
<SidebarNavItem Image={House} link={<Link href="#">Home</Link>} />
<SidebarNavItem Image={IconHome} link={<Link href="#">Home</Link>} />
<SidebarNavItem
Image={Graph}
Image={IconBarChart}
link={<Link href="#">Stats</Link>}
isActive
/>
<SidebarNavItem Image={Tools} link={<Link href="#">Tools</Link>} />
<SidebarNavItem Image={IconTune} link={<Link href="#">Settings</Link>} />
</SidebarNav>
)

Expand Down Expand Up @@ -105,13 +105,13 @@ export const WithNotifications: ComponentStory<typeof Sidebar> = (props) => {

const nav = (
<SidebarNav>
<SidebarNavItem Image={House} link={<Link href="#">Home</Link>} />
<SidebarNavItem Image={IconHome} link={<Link href="#">Home</Link>} />
<SidebarNavItem
Image={Graph}
Image={IconBarChart}
link={<Link href="#">Stats</Link>}
isActive
/>
<SidebarNavItem Image={Tools} link={<Link href="#">Tools</Link>} />
<SidebarNavItem Image={IconTune} link={<Link href="#">Settings</Link>} />
</SidebarNav>
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import '@testing-library/jest-dom/extend-expect'
import { fireEvent, render, RenderResult } from '@testing-library/react'
import { IconHome, IconBarChart, IconTune } from '@defencedigital/icon-library'

import { Link } from '../../Link'
import { Sidebar, SidebarNav, SidebarNavItem, SidebarUser } from './index'
import { Graph, House, Tools } from '../../../icons'
import { Notification, Notifications } from '../NotificationPanel'

describe('Sidebar', () => {
Expand Down Expand Up @@ -42,16 +42,16 @@ describe('Sidebar', () => {
<SidebarNav data-arbitrary="arbitrary-nav">
<SidebarNavItem
data-arbitrary="arbitrary-nav-item"
Image={House}
Image={IconHome}
link={<Link href="/">Home</Link>}
/>
<SidebarNavItem
Image={Graph}
Image={IconBarChart}
link={<Link href="/stats">Stats</Link>}
isActive
/>
<SidebarNavItem
Image={Tools}
Image={IconTune}
link={<Link href="/tools">Tools</Link>}
/>
</SidebarNav>
Expand Down
13 changes: 0 additions & 13 deletions packages/react-component-library/src/icons/Graph.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions packages/react-component-library/src/icons/House.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions packages/react-component-library/src/icons/Tools.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions packages/react-component-library/src/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
export * from './Graph'
export * from './House'
export * from './Logo'
export * from './Right-Arrow'
export * from './Search'
export * from './Tools'
export * from './Visibility'
export * from './VisibilityOff'

0 comments on commit d4bffdc

Please sign in to comment.