Skip to content

Commit 9cea323

Browse files
committed
display bp in header with stats
1 parent 221aef6 commit 9cea323

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

api/src/controllers/user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ export const getUserStats = async (req, res, next) => {
697697
return
698698
}
699699

700-
res.json(await getUserRatio(user._id))
700+
const ratioStats = await getUserRatio(user._id)
701+
res.json({ ...ratioStats, bp: user.bonusPoints })
701702
} catch (e) {
702703
next(e)
703704
}

client/pages/_app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { LoaderAlt } from '@styled-icons/boxicons-regular/LoaderAlt'
1818
import { Sort } from '@styled-icons/boxicons-regular/Sort'
1919
import { CaretUp } from '@styled-icons/boxicons-regular/CaretUp'
2020
import { CaretDown } from '@styled-icons/boxicons-regular/CaretDown'
21+
import { Award } from '@styled-icons/boxicons-regular/Award'
2122
import Navigation from '../components/Navigation'
2223
import Box from '../components/Box'
2324
import Button from '../components/Button'
@@ -322,9 +323,13 @@ const SqTracker = ({ Component, pageProps, initialTheme }) => {
322323
{prettyBytes(userStats.up ?? 0)}
323324
</Text>
324325
<CaretDown size={16} />
325-
<Text fontSize={0} ml={0} mr={4}>
326+
<Text fontSize={0} ml={0} mr={2}>
326327
{prettyBytes(userStats.down ?? 0)}
327328
</Text>
329+
<Award size={16} />
330+
<Text fontSize={0} ml={0} mr={4}>
331+
{userStats.bp ?? 0} BP
332+
</Text>
328333
</Box>
329334
)}
330335
<Box as="form" onSubmit={handleSearch}>

client/pages/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ const Index = ({
7373
if (query) router.push(`/search/${encodeURIComponent(query)}`)
7474
}
7575

76-
console.log(latestAnnouncement)
77-
7876
return (
7977
<>
8078
<SEO title="Home" />

0 commit comments

Comments
 (0)