Skip to content

Commit 4da04d1

Browse files
PROD-265 Simpilfied Work Intake UI
2 parents 8d91336 + 9010f7d commit 4da04d1

File tree

74 files changed

+884
-548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+884
-548
lines changed

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { toast, ToastContainer } from 'react-toastify'
55
import { EnvironmentConfig } from './config'
66
import { Header } from './header'
77
import { analyticsInitialize, logInitialize, ProfileProvider } from './lib'
8-
import { RouteContext, RouteContextData } from './lib/route-provider'
8+
import { routeContext, RouteContextData } from './lib/route-provider'
99

1010
analyticsInitialize(EnvironmentConfig)
1111
logInitialize(EnvironmentConfig)
1212

1313
const App: FC<{}> = () => {
1414

15-
const { allRoutes }: RouteContextData = useContext(RouteContext)
15+
const { allRoutes }: RouteContextData = useContext(routeContext)
1616

1717
const routeElements: Array<ReactElement> = allRoutes
1818
.map(route => {

src/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import classNames from 'classnames'
22
import { Dispatch, FC, SetStateAction, useContext, useState } from 'react'
33

4-
import { IconOutline, RouteContext, RouteContextData } from '../../../lib'
4+
import { IconOutline, routeContext, RouteContextData } from '../../../lib'
55

66
import { ToolSelectorNarrow } from './tool-selector-narrow'
77
import styles from './ToolSelectorsNarrow.module.scss'
88

99
const ToolSelectorsNarrow: FC<{}> = () => {
1010

11-
const { toolsRoutes }: RouteContextData = useContext(RouteContext)
11+
const { toolsRoutes }: RouteContextData = useContext(routeContext)
1212
const [isOpen, setIsOpen]: [boolean, Dispatch<SetStateAction<boolean>>] = useState<boolean>(false)
1313

1414
const closed: JSX.Element = <IconOutline.MenuIcon />

src/header/tool-selectors/tool-selectors-wide/ToolSelectorsWide.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { FC, useContext } from 'react'
22

3-
import { RouteContext, RouteContextData } from '../../../lib'
3+
import { routeContext, RouteContextData } from '../../../lib'
44

55
import { ToolSelectorWide } from './tool-selector-wide'
66
import styles from './ToolSelectorsWide.module.scss'
77

88
const ToolSelectorsWide: FC<{}> = () => {
99

10-
const { toolsRoutes }: RouteContextData = useContext(RouteContext)
10+
const { toolsRoutes }: RouteContextData = useContext(routeContext)
1111

1212
const selectors: Array<JSX.Element> = toolsRoutes
1313
.map(route => <ToolSelectorWide key={route.title} route={route} />)

src/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const ToolSelectorWide: FC<ToolSelectorWideProps> = (props: ToolSelectorWideProp
2323
<Link
2424
className='large-tab'
2525
tabIndex={-1}
26-
to={route}
26+
to={route}
2727
>
2828
{title}
2929
</Link>

src/header/utility-selectors/UtilitySelector/ProfileSelector/ProfileSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, useContext } from 'react'
22

3-
import { ProfileContext, ProfileContextData } from '../../../../lib'
3+
import { profileContext, ProfileContextData } from '../../../../lib'
44
import '../../../../lib/styles/index.scss'
55

66
import { ProfileLoggedIn } from './profile-logged-in'
@@ -12,7 +12,7 @@ const ProfileSelector: FC<{}> = () => {
1212
const {
1313
initialized,
1414
profile,
15-
}: ProfileContextData = useContext(ProfileContext)
15+
}: ProfileContextData = useContext(profileContext)
1616

1717
// if we're not initialized, don't render anything
1818
if (!initialized) {

src/header/utility-selectors/UtilitySelector/ProfileSelector/profile-logged-in/ProfileLoggedIn.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import { Dispatch, FC, SetStateAction, useContext, useState } from 'react'
22

3-
import { Avatar, IconOutline, logInfo , ProfileContext, ProfileContextData } from '../../../../../lib'
3+
import {
4+
Avatar,
5+
IconOutline,
6+
logInfo,
7+
profileContext,
8+
ProfileContextData,
9+
} from '../../../../../lib'
410

511
import { ProfilePanel } from './profile-panel'
612
import styles from './ProfileLoggedIn.module.scss'
713

814
const ProfileLoggedIn: FC<{}> = () => {
915

10-
const { profile }: ProfileContextData = useContext(ProfileContext)
16+
const { profile }: ProfileContextData = useContext(profileContext)
1117
const [profilePanelOpen, setProfilePanelOpen]: [boolean, Dispatch<SetStateAction<boolean>>] = useState<boolean>(false)
1218

1319
if (!profile) {

src/header/utility-selectors/UtilitySelector/ProfileSelector/profile-logged-in/profile-panel/ProfilePanel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { Link } from 'react-router-dom'
33

44
import {
55
authUrlLogout,
6-
ProfileContext,
6+
profileContext,
77
ProfileContextData,
8-
RouteContext,
8+
routeContext,
99
RouteContextData,
1010
} from '../../../../../../lib'
1111

@@ -17,8 +17,8 @@ interface ProfilePanelProps {
1717

1818
const ProfilePanel: FC<ProfilePanelProps> = (props: ProfilePanelProps) => {
1919

20-
const { profile }: ProfileContextData = useContext(ProfileContext)
21-
const { getPath }: RouteContextData = useContext(RouteContext)
20+
const { profile }: ProfileContextData = useContext(profileContext)
21+
const { getPath }: RouteContextData = useContext(routeContext)
2222

2323
if (!profile) {
2424
// this should never happen

src/lib/button/Button.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ import { Link } from 'react-router-dom'
44

55
import styles from './Button.module.scss'
66

7-
interface ButtonProps {
8-
readonly buttonStyle?: 'primary' | 'secondary' | 'tertiary' | 'text'
7+
export type ButtonSize = 'sm' | 'md' | 'lg' | 'xl'
8+
export type ButtonStyle = 'primary' | 'secondary' | 'tertiary' | 'text'
9+
export type ButtonType = 'button' | 'submit'
10+
11+
export interface ButtonProps {
12+
readonly buttonStyle?: ButtonStyle
913
readonly className?: string
1014
readonly disable?: boolean
1115
readonly label: string
1216
readonly onClick?: (event?: any) => void
1317
readonly route?: string
14-
readonly size?: 'sm' | 'md' | 'lg' | 'xl'
18+
readonly size?: ButtonSize
1519
readonly tabIndex: number
16-
readonly type?: 'button' | 'submit'
20+
readonly type?: ButtonType
1721
readonly url?: string
1822
}
1923

src/lib/button/Buttons.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import '@testing-library/jest-dom'
2+
3+
describe('<Button />', () => {
4+
5+
test('it should render the content', () => { })
6+
})

src/lib/button/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
export { default as Button } from './Button'
1+
export { default as Button } from './Button'
2+
export
3+
// tslint:disable-next-line: no-unused-expression
4+
type { ButtonSize } from './Button'
5+
export
6+
// tslint:disable-next-line: no-unused-expression
7+
type { ButtonStyle } from './Button'
8+
export
9+
// tslint:disable-next-line: no-unused-expression
10+
type { ButtonType } from './Button'

0 commit comments

Comments
 (0)