Skip to content

Commit

Permalink
Remove concept of active "framework"
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed Nov 9, 2023
1 parent 1e5d479 commit c173276
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 33 deletions.
4 changes: 1 addition & 3 deletions src/components/Nav/MobileMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ export default {
component: MobileMenu,
};

export const Default = () => (
<MobileMenu navLinks={defaultLinks} framework="react" version="6.5" apiKey="api_key" />
);
export const Default = () => <MobileMenu navLinks={defaultLinks} version="6.5" apiKey="api_key" />;
4 changes: 1 addition & 3 deletions src/components/Nav/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface MobileMenuProps {
navLinks: Links;
inverse?: boolean;
monochrome?: boolean;
framework: string;
version: string;
apiKey: string;
}
Expand All @@ -27,7 +26,6 @@ export const MobileMenu = ({
navLinks,
inverse,
monochrome,
framework,
version,
apiKey,
}: MobileMenuProps) => {
Expand All @@ -46,7 +44,7 @@ export const MobileMenu = ({
<Icon icon="menualt" />
</IconButton>
<Drawer open={open} setOpen={setOpen} label="nav links">
<GlobalSearch apiKey={apiKey} version={version} framework={framework} />
<GlobalSearch apiKey={apiKey} version={version} />
{mobileGroupsWithLinks.map((group) => (
<StackedNav key={group.label} label={group.label}>
{group.items.map((item) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/Nav.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const FullStack = () => (
link="https://storybook.js.org/blog/storybook-lazy-compilation-for-webpack/"
githubStarCount={73724}
/>
<Nav apiKey="ALGOLIA_API_KEY" framework="react" version="6.5" activeSection="showcase" />
<Nav apiKey="ALGOLIA_API_KEY" version="6.5" activeSection="showcase" />
<SubNav>
<SubNavBreadcrumb tertiary href="/back">
<Icon icon="arrowleft" />
Expand Down
11 changes: 1 addition & 10 deletions src/components/Nav/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ const MobileNav = styled(MobileMenu)`
interface NavProps {
inverse?: boolean;
monochrome?: boolean;
framework: string;
version: string;
apiKey: string;
activeSection?: 'home' | 'why' | 'docs' | 'integrations' | 'showcase' | 'community';
Expand All @@ -130,7 +129,6 @@ const NavLinks = styled.div`
export const Nav: FunctionComponent<NavProps> = ({
inverse,
monochrome,
framework = 'react',
version = '6.5',
apiKey,
activeSection = 'home',
Expand Down Expand Up @@ -200,13 +198,7 @@ export const Nav: FunctionComponent<NavProps> = ({
Enterprise
</NavItem>
</NavLinks>
<GlobalSearch
monochrome={monochrome}
framework={framework}
apiKey={apiKey}
version={version}
inverse={inverse}
/>
<GlobalSearch monochrome={monochrome} apiKey={apiKey} version={version} inverse={inverse} />
{/* Collapsed navs for tablet and mobile */}
<TabletNav navLinks={navLinks} inverse={inverse} monochrome={monochrome} />
<MobileNav
Expand All @@ -215,7 +207,6 @@ export const Nav: FunctionComponent<NavProps> = ({
monochrome={monochrome}
apiKey={apiKey}
version={version}
framework={framework}
/>
</NavContainer>
</Wrapper>
Expand Down
1 change: 0 additions & 1 deletion src/components/Search.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const Template = (args) => <Search {...args} />;

export const Default = Template.bind({});
Default.args = {
framework: 'react',
version: 6.5,
apiKey: 'ALGOLIA_API_KEY',
};
Expand Down
10 changes: 1 addition & 9 deletions src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const algoliaDocSearchConfig = {
};

interface SearchProps {
framework: string;
version: string;
className?: string | undefined;
inverse?: boolean;
Expand Down Expand Up @@ -143,13 +142,7 @@ const Shortcut: React.FC<{ keys: string[] }> = ({ keys }) => (

const label = 'Search docs';

export const Search: FunctionComponent<SearchProps> = ({
framework,
version,
inverse,
className,
apiKey,
}) => (
export const Search: FunctionComponent<SearchProps> = ({ version, inverse, className, apiKey }) => (
<>
{/* <GlobalStyle /> why do we need this? */}
<Global styles={docSearchStyles} />
Expand All @@ -168,7 +161,6 @@ export const Search: FunctionComponent<SearchProps> = ({
between the containing values
*/
[`tags:docs`, `tags:recipes`],
[`framework:${framework}`, `framework:agnostic`],
[`version:${version}`, `version:agnostic`],
],
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const SearchBlock: FC<SearchBlockProps> = ({ version, apiKey }) => {
<Desc>There’s probably an article for your issue already.</Desc>
</div>
<SearchWrapper>
<StyledSearch framework="react" version={version} apiKey={apiKey} />
<StyledSearch version={version} apiKey={apiKey} />
</SearchWrapper>
</Meta>
</Wrapper>
Expand Down
10 changes: 5 additions & 5 deletions src/components/SubNav/SubNav.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const communityItems: SubNavLinkItem[] = [
},
];

const frameworkOptions = Grouped.args.items;
const rendererOptions = Grouped.args.items;
const versionOptions = [
{
label: 'stable',
Expand All @@ -82,8 +82,8 @@ const versionOptions = [
},
];

const FrameworkSelect = () => (
<Menu label={frameworkOptions[0].items[0].label} items={frameworkOptions} primary />
const RendererSelect = () => (
<Menu label={rendererOptions[0].items[0].label} items={rendererOptions} primary />
);

const VersionSelect = () => (
Expand Down Expand Up @@ -116,7 +116,7 @@ export const TabMenusLinklist = () => (
<SubNavTabs label="Docs nav" items={docsItems} />
<SubNavDivider />
<SubNavMenus>
<FrameworkSelect />
<RendererSelect />
<VersionSelect />
</SubNavMenus>
<SubNavRight>
Expand Down Expand Up @@ -175,7 +175,7 @@ export const BreadcrumbMenuLinklist = () => (
</SubNavBreadcrumb>
<SubNavDivider />
<SubNavMenus>
<FrameworkSelect />
<RendererSelect />
<VersionSelect />
</SubNavMenus>
<SubNavRight>
Expand Down

0 comments on commit c173276

Please sign in to comment.