-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): header / footer fragment colocation (#720)
- Loading branch information
Showing
16 changed files
with
389 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { ComponentPropsWithoutRef } from 'react'; | ||
import { FragmentOf, graphql } from '~/client/graphql'; | ||
|
||
import { getStoreSettings } from '~/client/queries/get-store-settings'; | ||
|
||
export const Copyright = async (props: ComponentPropsWithoutRef<'p'>) => { | ||
const settings = await getStoreSettings(); | ||
|
||
if (!settings) { | ||
return null; | ||
export const CopyrightFragment = graphql(` | ||
fragment CopyrightFragment on Settings { | ||
storeName | ||
} | ||
`); | ||
|
||
interface Props { | ||
data: FragmentOf<typeof CopyrightFragment>; | ||
} | ||
|
||
export const Copyright = ({ data }: Props) => { | ||
return ( | ||
<p className="text-gray-500 sm:order-first" {...props}> | ||
© {new Date().getFullYear()} {settings.storeName} – Powered by BigCommerce | ||
<p className="text-gray-500 sm:order-first"> | ||
© {new Date().getFullYear()} {data.storeName} – Powered by BigCommerce | ||
</p> | ||
); | ||
}; |
24 changes: 21 additions & 3 deletions
24
apps/core/components/footer/footer-menus/brand-footer-menu.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.