-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added intro text and quote in home page
- Loading branch information
1 parent
c05a2d7
commit ca9ab59
Showing
4 changed files
with
46 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.uaapp_quote { | ||
margin: 20px 0; | ||
text-align: right; | ||
} | ||
|
||
.uaapp_quote q { | ||
font-style: italic; | ||
} | ||
|
||
.uaapp_quote footer { | ||
font-size: smaller; | ||
} |
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,11 +1,27 @@ | ||
import { getRandomQuote } from '../src/api/quote' | ||
import { HeroImage } from '../src/views/hero-image' | ||
import styles from './app.module.css' | ||
|
||
export const dynamic = 'force-dynamic' | ||
|
||
export default async function AppPage() { | ||
const quote = await getRandomQuote() | ||
|
||
export default function RootPage() { | ||
return ( | ||
<> | ||
<h1>unknown art</h1> | ||
|
||
<p> | ||
unknown art is where you can, hopefully, get in contact with persons, | ||
lovers, thinkers, minds or artists, all over the beautiful world. | ||
</p> | ||
|
||
<HeroImage /> | ||
|
||
<blockquote className={styles.uaapp_quote}> | ||
<q>{quote.message}</q> | ||
<footer>{quote.author}</footer> | ||
</blockquote> | ||
</> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Quote } from '../../../src/types/quote' | ||
import clientPromise from '../../config/mongodb' | ||
|
||
export const getRandomQuote = async (): Promise<Quote> => { | ||
const mongoClient = await clientPromise | ||
const data = await mongoClient | ||
.db('ua-db') | ||
.collection('ua-quotes') | ||
.aggregate([{ $sample: { size: 1 } }]) | ||
.toArray() | ||
|
||
return JSON.parse(JSON.stringify(data[0])) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type Quote = { | ||
message: string | ||
author: string | ||
} |