Skip to content

Commit

Permalink
Merge pull request #568 from StampyAI/sundry-fixes
Browse files Browse the repository at this point in the history
typos + title
  • Loading branch information
mruwnik authored Mar 27, 2024
2 parents 47e3555 + 439faa1 commit dd1e10e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/components/ContentBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const ContentBoxMain = () => (
action={questionUrl({pageid: '9OGZ'})}
actionTitle={
<>
<span className="default-bold">Start reading</span>
<span className="default-bold">Start here</span>
<ArrowRight />
</>
}
Expand Down
4 changes: 2 additions & 2 deletions app/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const FooterBar: FunctionComponent = () => {
<a href="/">AISafety.info</a>
</p>
<div>
We’re a global team of specialists supported by volunteers from various backgrounds who
are concerned about the possibility of human extinction from future AI.
We’re a global team of specialists and volunteers from various backgrounds who want to
ensure that the effects of future AI are beneficial rather than catastrophic.
</div>
</div>

Expand Down
1 change: 0 additions & 1 deletion app/components/Grid/grid.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
text-align: left;
padding: var(--spacing-40);
width: 21.46vw;
height: 21.46vw;
min-width: var(--spacing-288);
min-height: var(--spacing-288);
text-decoration: none;
Expand Down
14 changes: 7 additions & 7 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import newStyles from '~/newRoot.css'
import Error from '~/components/Error'
import Page from '~/components/Page'
import {CachedObjectsProvider} from '~/hooks/useCachedObjects'
import {questionsOnPage} from '~/hooks/stateModifiers'
import {useTheme} from '~/hooks/theme'
import {loadQuestionDetail} from '~/server-utils/stampy'

Expand Down Expand Up @@ -47,15 +46,16 @@ const makeSocialPreviewText = (
*/
const fetchQuestion = async (request: Request) => {
const url = new URL(request.url)
const questions = questionsOnPage(url.searchParams.get('state') || '')

if (questions.length != 1) return null

const {data} = await loadQuestionDetail(request, questions[0][0])
return data
const [path, pageid] = url.pathname.slice(1).split('/') || []
if (path === 'questions') {
const {data} = await loadQuestionDetail(request, pageid)
return data
}
return null
}

const TITLE = 'Stampy'
const TITLE = 'AISafety.info'
const DESCRIPTION = 'AI Safety FAQ'
const twitterCreator = '@stampyai'
export const meta: MetaFunction<typeof loader> = ({data = {} as any}) => {
Expand Down
2 changes: 1 addition & 1 deletion app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function App() {
return (
<Page>
<div className="page-body">
<h1 className="padding-bottom-80 padding-top-56">Answers on all things AI safety</h1>
<h1 className="padding-bottom-80 padding-top-56">Your guide to AI safety</h1>

<ContentBoxMain />
<ContentBoxSecond />
Expand Down
7 changes: 7 additions & 0 deletions app/routes/questions.$questionId.$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ export default function RenderArticle() {
setShowNav(false)
}, [location.key])

useEffect(() => {
data.then((val) => {
const question = val as Question
if (question.title) document.title = question.title
})
}, [data])

return (
<Page modal={showNav}>
<div className={`article-container ${showNav ? 'no-padding' : ''}`}>
Expand Down
5 changes: 4 additions & 1 deletion app/routes/questions.toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export const loadToC = async (request: any): Promise<LoaderResp> => {
[k: string]: Question
}
const canBeShown = ({status}: Question) =>
status && [QuestionStatus.LIVE_ON_SITE, QuestionStatus.NOT_STARTED].includes(status)
status &&
[QuestionStatus.LIVE_ON_SITE, QuestionStatus.NOT_STARTED, QuestionStatus.SUBSECTION].includes(
status
)

data
.filter(canBeShown)
Expand Down
1 change: 1 addition & 0 deletions app/server-utils/stampy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export enum QuestionStatus {
IN_PROGRESS = 'In progress',
IN_REVIEW = 'In review',
LIVE_ON_SITE = 'Live on site',
SUBSECTION = 'Subsection',
UNKNOWN = 'Unknown',
}
export type Banner = {
Expand Down

0 comments on commit dd1e10e

Please sign in to comment.