diff --git a/config.json.example b/config.json.example index 20a992c..ad9ffe1 100644 --- a/config.json.example +++ b/config.json.example @@ -45,5 +45,44 @@ "href": "mailto:support@pulseapp.cc", "navbar": false } - ] + ], + "footer": { + "homeUrl": "https://pulseapp.cc", + "links": { + "Resources": [ + { + "name": "Support", + "href": "https://support.pulseapp.cc" + }, + { + "name": "Jobs", + "href": "https://jobs.pulseapp.cc" + }, + { + "name": "Developers", + "shortName": "Devs", + "href": "https://dev.pulseapp.cc", + "external": true + }, + { + "name": "System Status", + "shortName": "Status", + "href": "https://status.pulseapp.cc", + "external": true + } + ], + "Legal": [ + { + "name": "Terms & Conditions", + "shortName": "Terms", + "href": "/legal/terms" + }, + { + "name": "Privacy Policy", + "shortName": "Privacy", + "href": "/legal/privacy" + } + ] + } + } } \ No newline at end of file diff --git a/src/app/types/config.ts b/src/app/types/config.ts index 9eed5d3..cc58dfb 100644 --- a/src/app/types/config.ts +++ b/src/app/types/config.ts @@ -27,6 +27,23 @@ export type Config = { * Social links for this app. */ socialLinks: SocialLinkType[]; + + /** + * Configuration for the footer. + */ + footer: { + /** + * The URL to link to when the branding is clicked. + */ + homeUrl: string; + + /** + * Links for the footer. + */ + links: { + [category: string]: FooterLink[]; + }; + }; }; export type SocialLinkType = { @@ -57,3 +74,26 @@ export type SocialLinkType = { */ navbar: boolean; }; + +export type FooterLink = { + /** + * The name of this link. + */ + name: string; + + /** + * The href for this link. + */ + href: string; + + /** + * The optional name to show + * when the screen size is small. + */ + shortName?: string; + + /** + * Is this an external link? + */ + external?: boolean; +}; diff --git a/src/components/footer.tsx b/src/components/footer.tsx index d51cc1c..96bc890 100644 --- a/src/components/footer.tsx +++ b/src/components/footer.tsx @@ -10,43 +10,6 @@ import SocialLink from "@/components/social-link"; import config from "@/config"; import { SocialLinkType } from "@/types/config"; -const links = { - Resources: [ - { - name: "Support", - href: "https://support.pulseapp.cc", - }, - { - name: "Jobs", - href: "https://jobs.pulseapp.cc", - }, - { - name: "Developers", - shortName: "Devs", - href: "https://dev.pulseapp.cc", - external: true, - }, - { - name: "System Status", - shortName: "Status", - href: "https://status.pulseapp.cc", - external: true, - }, - ], - Legal: [ - { - name: "Terms & Conditions", - shortName: "Terms", - href: "/legal/terms", - }, - { - name: "Privacy Policy", - shortName: "Privacy", - href: "/legal/privacy", - }, - ], -}; - const Footer = (): ReactElement => (