From a3624876168b35d949fc36b592e8308922d83f29 Mon Sep 17 00:00:00 2001 From: Daniel O'Connell Date: Sat, 26 Oct 2024 20:09:45 +0200 Subject: [PATCH 1/2] overrides for footer --- app/components/HowCanIHelp/Base.tsx | 11 +- app/components/HowCanIHelp/HelpMethods.tsx | 123 ++++++++++++++++----- app/routes/how-can-i-help.career.tsx | 2 +- app/routes/how-can-i-help.community.tsx | 2 +- app/routes/how-can-i-help.donate.tsx | 2 +- app/routes/how-can-i-help.grassroots.tsx | 2 +- app/routes/how-can-i-help.knowledge.tsx | 2 +- app/routes/how-can-i-help.volunteer.tsx | 2 +- 8 files changed, 109 insertions(+), 37 deletions(-) diff --git a/app/components/HowCanIHelp/Base.tsx b/app/components/HowCanIHelp/Base.tsx index 2482d87c..155c4089 100644 --- a/app/components/HowCanIHelp/Base.tsx +++ b/app/components/HowCanIHelp/Base.tsx @@ -1,15 +1,14 @@ import {Link} from '@remix-run/react' import Page from '~/components/Page' -import HelpMethods from '~/components/HowCanIHelp/HelpMethods' -import {HelpPage, helpUrl} from '~/routesMapper' +import HelpMethods, {HelpMethodsProps} from '~/components/HowCanIHelp/HelpMethods' +import {helpUrl} from '~/routesMapper' import {ReactNode} from 'react' type BaseProps = { title: string - subpage: HelpPage children: ReactNode -} -export default function Base({title, subpage, children}: BaseProps) { +} & HelpMethodsProps +export default function Base({title, current, children, ...props}: BaseProps) { return (
@@ -22,7 +21,7 @@ export default function Base({title, subpage, children}: BaseProps) { {children} - +
diff --git a/app/components/HowCanIHelp/HelpMethods.tsx b/app/components/HowCanIHelp/HelpMethods.tsx index aa6a4b55..190c5887 100644 --- a/app/components/HowCanIHelp/HelpMethods.tsx +++ b/app/components/HowCanIHelp/HelpMethods.tsx @@ -1,3 +1,4 @@ +import {ReactNode} from 'react' import Card from '~/components/Card' import CardSmall from '~/components/CardSmall' import {HelpPage, helpUrl} from '~/routesMapper' @@ -8,39 +9,111 @@ import {Megaphone} from '~/components/icons-generated' import {PiggyBank} from '~/components/icons-generated' import {Hand} from '~/components/icons-generated' -type HelpMethodsProps = { +const titles = { + career: ( +
+ Multiply your impact: +
+ Support your career pursuit +
+ ), + grassroots: ( +
+ Multiply your positive impact: +
+ Support your advocacy efforts +
+ ), + donate: ( +
+ Multiply your postive impact: +
+ Support your donation efforts +
+ ), + volunteer: ( +
+ Multiply your positive impact: +
+ Support your volunteer efforts +
+ ), + knowledge: ( +
+ Boost your learning efforts: +
+ Join a community +
+ ), + community: ( +
+ Boost your efforts: +
+ Learn more about AI safety +
+ ), +} + +const knowledgeDescriptions = { + donate: 'The more you know about this topic, the further your donation efforts will go', +} + +const communityDescriptions = { + donate: + 'Connecting with other advocates online or in person will help guide donation decisions, and can be motivating', +} + +const KnowledgeCard = ({current}: {current?: HelpPage}) => { + if (current == 'knowledge') return null + const defaultDescription = + 'Learning more about AI safety and the alignment problem is essential if you want to pursue a career in this field' + return ( + + ) +} + +const CommunityCard = ({current}: {current?: string}) => { + if (current === 'community') return null + const defaultDescription = + 'Connecting with others online or in person will help you navigate the transition to a career in AI safety' + return ( + + ) +} + +export type HelpMethodsProps = { current?: HelpPage - header?: string - subheader?: string + footerTitle?: ReactNode + footerSubheader?: ReactNode } const HelpMethods = ({ current, - header = 'Multiply your impact: Support your career pursuit', - subheader = 'Or, explore more ways to help directly', + footerTitle, + footerSubheader = 'Or, explore more ways to help directly', }: HelpMethodsProps) => (
-

{header}

+

{footerTitle || (current && titles[current])}

- {current !== 'knowledge' && ( - - )} - {current !== 'community' && ( - - )} + +
-

{subheader}

+

{footerSubheader}

{current !== 'career' && ( + diff --git a/app/routes/how-can-i-help.community.tsx b/app/routes/how-can-i-help.community.tsx index 07d78217..c486e813 100644 --- a/app/routes/how-can-i-help.community.tsx +++ b/app/routes/how-can-i-help.community.tsx @@ -7,7 +7,7 @@ export const meta: MetaFunction = () => { export default function Community() { return ( - +
fill me out, please
) diff --git a/app/routes/how-can-i-help.donate.tsx b/app/routes/how-can-i-help.donate.tsx index ec5c440c..6e77bed4 100644 --- a/app/routes/how-can-i-help.donate.tsx +++ b/app/routes/how-can-i-help.donate.tsx @@ -10,7 +10,7 @@ export const meta: MetaFunction = () => { export default function Donate() { return ( - +
diff --git a/app/routes/how-can-i-help.grassroots.tsx b/app/routes/how-can-i-help.grassroots.tsx index 681943c4..f5f84597 100644 --- a/app/routes/how-can-i-help.grassroots.tsx +++ b/app/routes/how-can-i-help.grassroots.tsx @@ -7,7 +7,7 @@ export const meta: MetaFunction = () => { export default function Grassroots() { return ( - +
fill me out, please
) diff --git a/app/routes/how-can-i-help.knowledge.tsx b/app/routes/how-can-i-help.knowledge.tsx index 64d62758..4d73d5da 100644 --- a/app/routes/how-can-i-help.knowledge.tsx +++ b/app/routes/how-can-i-help.knowledge.tsx @@ -216,7 +216,7 @@ export default function Knowledge() { } }, []) return ( - + diff --git a/app/routes/how-can-i-help.volunteer.tsx b/app/routes/how-can-i-help.volunteer.tsx index 1bc73101..8bb0b3c4 100644 --- a/app/routes/how-can-i-help.volunteer.tsx +++ b/app/routes/how-can-i-help.volunteer.tsx @@ -7,7 +7,7 @@ export const meta: MetaFunction = () => { export default function Volunteer() { return ( - +
fill me out, please
) From 9aad2988a18da97abdb99e3dfdd943d231367741 Mon Sep 17 00:00:00 2001 From: Daniel O'Connell Date: Sat, 26 Oct 2024 20:17:40 +0200 Subject: [PATCH 2/2] update footer --- app/components/Card/index.tsx | 24 ++++++++++++++++++---- app/components/HowCanIHelp/HelpMethods.tsx | 2 ++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/components/Card/index.tsx b/app/components/Card/index.tsx index 62a00589..17564bc0 100644 --- a/app/components/Card/index.tsx +++ b/app/components/Card/index.tsx @@ -1,17 +1,27 @@ -import {SVGProps} from 'react' -import Button from '../Button' +import {ReactNode, SVGProps} from 'react' +import Button from '~/components/Button' +import {ArrowRight} from '~/components/icons-generated' import './card.css' interface CardProps { title: string - description: string + description: ReactNode impact?: string icon: (props: SVGProps) => JSX.Element action: string + actionDesc?: string className?: string } -export default function Card({title, description, impact, icon, action, className}: CardProps) { +export default function Card({ + title, + description, + impact, + icon, + action, + actionDesc, + className, +}: CardProps) { className = `card bordered ${className}` return ( @@ -20,6 +30,12 @@ export default function Card({title, description, impact, icon, action, classNam

{title}

{description}

+ {actionDesc && ( +

+ {actionDesc} + +

+ )} {impact &&

{impact}

}
diff --git a/app/components/HowCanIHelp/HelpMethods.tsx b/app/components/HowCanIHelp/HelpMethods.tsx index 190c5887..dfe4ba50 100644 --- a/app/components/HowCanIHelp/HelpMethods.tsx +++ b/app/components/HowCanIHelp/HelpMethods.tsx @@ -70,6 +70,7 @@ const KnowledgeCard = ({current}: {current?: HelpPage}) => { return ( { return (