Skip to content

Commit

Permalink
refactor: index context import (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Palmaswell authored Feb 14, 2020
1 parent 067a345 commit 8bce588
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Router from 'next/router';

import * as Color from '../color';
import * as Component from '../components';
import * as Container from '../context';
import * as Type from '../types';
import { BuiltInConsumer, ColorManagerConsumer, Upload } from '../context';
import { ColorExtendedProps } from '../color';

const handleClick = (ctx): void => {
Expand All @@ -23,7 +23,7 @@ export default function Index(): JSX.Element {
title="Forward - color contrast accessibility checker"
description="Forward - color contrast accessibility checker"
/>
<Container.BuiltInConsumer>
<BuiltInConsumer>
{(builtInCtx: Type.HashTbl<ColorExtendedProps>) => (
<>
<Component.Layout>
Expand Down Expand Up @@ -51,12 +51,12 @@ export default function Index(): JSX.Element {
The design needs to meet color contrast requirements for
people with vision or color perception deficiencies.
</Component.Copy>
<Container.ColorManagerConsumer>
<ColorManagerConsumer>
{ctx => {
return (
<>
<Component.Space size={[Component.Size.S, 0]}>
<Container.Upload ctx={ctx} />
<Upload ctx={ctx} />
</Component.Space>
<Component.LinkBtn
color={builtInCtx.get('White').toRGB()}
Expand All @@ -66,7 +66,7 @@ export default function Index(): JSX.Element {
</>
);
}}
</Container.ColorManagerConsumer>
</ColorManagerConsumer>
</Component.Space>
</Component.LayoutItem>
<Component.LayoutItem
Expand Down Expand Up @@ -100,7 +100,7 @@ export default function Index(): JSX.Element {
<Component.TransitionLayer theme={builtInCtx} transition={false} />
</>
)}
</Container.BuiltInConsumer>
</BuiltInConsumer>
</>
);
}

1 comment on commit 8bce588

@vercel
Copy link

@vercel vercel bot commented on 8bce588 Feb 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.