Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1479 from iFixit/fix-ui-package
Browse files Browse the repository at this point in the history
Footer Package: don't rely on @ifixit/ui
  • Loading branch information
aburke07 authored Mar 21, 2023
2 parents 4f92d97 + fb73cfb commit 5faa6c9
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 17 deletions.
4 changes: 2 additions & 2 deletions frontend/layouts/default/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { trackInMatomoAndGA } from '@ifixit/analytics';
import { Menu, MenuList } from '@chakra-ui/react';
import { Flag, FlagCountryCode, Language } from '@ifixit/icons';
import type { MenuItem } from '@ifixit/ui';
import { MenuItemType } from '@ifixit/ui';
import type { MenuItem } from '@ifixit/menu';
import { MenuItemType } from '@ifixit/menu';
import { ResponsiveImage } from '@ifixit/ui';
import noImageFixie from '@assets/images/no-image-fixie.jpeg';
import type { GlobalSettings } from '@models/global-settings';
Expand Down
2 changes: 1 addition & 1 deletion frontend/layouts/default/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import {
Wordmark,
WordmarkLink,
} from '@ifixit/ui';
import type { Menu } from '@ifixit/ui';
import type { Menu } from '@ifixit/menu';
import Head from 'next/head';
import NextLink from 'next/link';
import { useRouter } from 'next/router';
Expand Down
4 changes: 2 additions & 2 deletions frontend/models/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import type {
MenuItem,
ProductListLinkMenuItem,
SubmenuMenuItem,
} from '@ifixit/ui';
import { MenuItemType } from '@ifixit/ui';
} from '@ifixit/menu';
import { MenuItemType } from '@ifixit/menu';

export type Store = Awaited<ReturnType<typeof findStoreByCode>>;

Expand Down
1 change: 1 addition & 0 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const withTM = require('next-transpile-modules')([
'@ifixit/sentry',
'@ifixit/shopify-storefront-client',
'@ifixit/ui',
'@ifixit/menu',
]);

const { withSentryConfig } = require('@sentry/nextjs');
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@ifixit/sentry": "workspace:*",
"@ifixit/shopify-storefront-client": "workspace:*",
"@ifixit/ui": "workspace:*",
"@ifixit/menu": "workspace:*",
"@sentry/nextjs": "7.42.0",
"@sentry/tracing": "7.42.0",
"@tanstack/react-query": "4.14.5",
Expand Down
2 changes: 1 addition & 1 deletion frontend/tests/jest/__mocks__/products.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CurrencyCode } from '@lib/shopify-storefront-sdk';
import type { FindProductQuery } from '@lib/shopify-storefront-sdk';
import { MenuItemType } from '@ifixit/ui/menu';
import { MenuItemType } from '@ifixit/menu';
import type { ProductSearchHit } from '@models/product-list';
import type { ProductReview } from '@models/product/reviews';
import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/footer/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
} from '@chakra-ui/react';
import { NewsletterComponent } from './Newsletter';
import type { NewsletterFormProps } from './Newsletter';
import type { Menu as MenuType, MenuItem } from '@ifixit/ui';
import type { Menu as MenuType, MenuItem } from '@ifixit/menu';
import { useTrackedOnClick } from '../hooks/useTrackedOnClick';

type NavSectionProps = {
Expand Down
15 changes: 12 additions & 3 deletions packages/footer/components/Shared.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Divider, Box, forwardRef, HStack, Icon, Text } from '@chakra-ui/react';
import type { DividerProps, FlexProps, StackProps } from '@chakra-ui/react';
import type { Menu } from '@ifixit/ui';
import type { Menu } from '@ifixit/menu';
import { useTrackedOnClick } from '../hooks/useTrackedOnClick';
import { Wrapper } from '@ifixit/ui';

export interface FooterType {
menu1: Menu | null;
Expand All @@ -16,7 +15,17 @@ export const Footer = forwardRef<FlexProps, 'footer'>(
({ children, ...otherProps }, ref) => {
return (
<Box ref={ref} as="footer" bg="black" py="12" {...otherProps}>
<Wrapper>{children}</Wrapper>
<Box
maxW="80rem"
mx="auto"
px={{
base: 4,
md: 6,
lg: 8,
}}
>
{children}
</Box>
</Box>
);
}
Expand Down
13 changes: 10 additions & 3 deletions packages/footer/homepage-kpis/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Box, SimpleGrid, Stat, StatLabel, StatNumber } from '@chakra-ui/react';
import { Wrapper } from '@ifixit/ui';

interface Stat {
value: string;
Expand Down Expand Up @@ -27,7 +26,15 @@ export function StatsSection({ data: { stats } }: StatsSectionProps) {
borderColor="blue.100"
mb={-10}
>
<Wrapper>
<Box
maxW="80rem"
mx="auto"
px={{
base: 4,
md: 6,
lg: 8,
}}
>
<SimpleGrid
columns={{
base: 1,
Expand All @@ -45,7 +52,7 @@ export function StatsSection({ data: { stats } }: StatsSectionProps) {
/>
))}
</SimpleGrid>
</Wrapper>
</Box>
</Box>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/footer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type-check": "tsc --pretty --noEmit"
},
"dependencies": {
"@ifixit/ui": "workspace:*",
"@ifixit/menu": "workspace:*",
"@ifixit/newsletter-sdk": "workspace:*",
"@ifixit/icons": "workspace:*"
},
Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions packages/menu/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@ifixit/menu",
"version": "0.0.0",
"main": "./index.tsx",
"types": "./index.tsx",
"license": "MIT",
"exports": {
".": "./index.ts"
},
"scripts": {
"build": "",
"clean": "",
"type-check": "tsc --pretty --noEmit"
},
"devDependencies": {
"@ifixit/tsconfig": "workspace:*",
"typescript": "4.8.4"
}
}
5 changes: 5 additions & 0 deletions packages/menu/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@ifixit/tsconfig/react-library.json",
"include": ["."],
"exclude": ["dist", "build", "node_modules"]
}
1 change: 0 additions & 1 deletion packages/ui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ export * from './misc';
export * from './theme';
export * from './cart';
export * from './commerce';
export * from './menu';
14 changes: 12 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 comments on commit 5faa6c9

@vercel
Copy link

@vercel vercel bot commented on 5faa6c9 Mar 21, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

react-commerce-prod – ./frontend

react-commerce-prod-git-main-ifixit.vercel.app
react-commerce-prod-ifixit.vercel.app
react-commerce-prod.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 5faa6c9 Mar 21, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

react-commerce – ./frontend

react-commerce-ifixit.vercel.app
react-commerce.vercel.app
react-commerce-git-main-ifixit.vercel.app

Please sign in to comment.