From 5af0ada41e0807accb8e71179e6989dc22f72fa1 Mon Sep 17 00:00:00 2001 From: Maria Navarro <39739180+MariaJose@users.noreply.github.com> Date: Mon, 14 Mar 2022 10:13:26 -0500 Subject: [PATCH] feat(docs): update icon page to use new layout (#756) * feat(docs): update icon page to use new layout * feat(docs): update icon page to use new layout * feat(docs): add comma to a sentence --- packages/docs/pages/icons.tsx | 339 +++++++++++++++++++--------------- 1 file changed, 185 insertions(+), 154 deletions(-) diff --git a/packages/docs/pages/icons.tsx b/packages/docs/pages/icons.tsx index 391ef1e22..11a8118c3 100644 --- a/packages/docs/pages/icons.tsx +++ b/packages/docs/pages/icons.tsx @@ -15,9 +15,9 @@ import { RUFlagIcon, USFlagIcon, } from '@bigcommerce/big-design-icons/flags'; -import React, { useEffect, useState } from 'react'; +import React, { Fragment, useEffect, useState } from 'react'; -import { Code, CodePreview, CodeSnippet, PageNavigation } from '../components'; +import { Code, CodePreview, CodeSnippet, ContentRoutingTabs, List, NextLink } from '../components'; import { FlagIconPropTable, IconPropTable } from '../PropTables'; type BigDesignIcons = Omit; @@ -35,162 +35,193 @@ const IconsPage = () => { fetchIcons(); }, []); - const items = [ - { - id: 'examples', - title: 'Examples', - render: () => ( - <> - - To use an icon import the component from the package: - {`import { CheckIcon } from '@bigcommerce/big-design-icons';`} - Use it anywhere in your app: - - {/* jsx-to-string:start */} - - {/* jsx-to-string:end */} - - - - - A complete list of available flags is located{' '} - - here - - . - - - To use a flag import the component from the package: - - {`import { USFlagIcon } from '@bigcommerce/big-design-icons/flags';`} - - Use it anywhere in your app: - - - {/* jsx-to-string:start */} - - {/* jsx-to-string:end */} - - - - {/* jsx-to-string:start */} - {function Example() { - const [value, setValue] = useState(''); - const handleChange = (val) => setValue(val); - - return ( -
- - }, + { value: 'mx', content: 'Mexico', icon: }, + { value: 'ca', content: 'Canada', icon: }, + { value: 'en', content: 'England', icon: }, + { value: 'fr', content: 'France', icon: }, + { value: 'gr', content: 'Germany', icon: }, + { value: 'ar', content: 'Argentina', icon: }, + { value: 'ru', content: 'Russia', disabled: true, icon: }, + { value: 'ch', content: 'Chile', icon: }, + { value: 'jp', content: 'Japan', icon: }, + { value: 'cn', content: 'China', icon: }, + { value: 'sk', content: 'South Korea', icon: }, + { value: 'au', content: 'Australia', icon: }, + ]} + placeholder={'Choose country'} + placement={'bottom-start'} + required + value={value} + /> + +
+ ); + }} + {/* jsx-to-string:end */} +
+ + ), + }, + ]} + /> +
+ + ( + + + npm install @bigcommerce/big-design-icons // or yarn add @bigcommerce/big-design-icons + + + ), + }, + { + id: 'flag-icon', + title: 'Flag icon', + render: () => ( + + + + ), + }, + ]} + /> + + + + + {Object.keys(icons).map((iconName) => { + const Icon = icons[iconName]; + + return ( + + + {`<${iconName} />`} + + ); + })} + + ); };