mirror of
https://github.com/Steffo99/steffoweb.git
synced 2024-11-25 09:34:31 +00:00
🔧 Exclude displayed projects from the "More" count
This commit is contained in:
parent
2f1562798f
commit
eea825074f
2 changed files with 3 additions and 3 deletions
|
@ -57,7 +57,7 @@ function App() {
|
||||||
<Project user={"Steffo99"} repo={"flyingsnake"}/>
|
<Project user={"Steffo99"} repo={"flyingsnake"}/>
|
||||||
<Project user={"pds-nest"} repo={"nest"}/>
|
<Project user={"pds-nest"} repo={"nest"}/>
|
||||||
<Project user={"Steffo99"} repo={"keep-everything-alive"}/>
|
<Project user={"Steffo99"} repo={"keep-everything-alive"}/>
|
||||||
<MoreProjects user={"Steffo99"}/>
|
<MoreProjects user={"Steffo99"} minus={7}/>
|
||||||
</Box>
|
</Box>
|
||||||
</Chapter>
|
</Chapter>
|
||||||
<Chapter>
|
<Chapter>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {Anchor} from "@steffo/bluelib-react"
|
||||||
import Style from "./MoreProjects.module.css"
|
import Style from "./MoreProjects.module.css"
|
||||||
|
|
||||||
|
|
||||||
export function MoreProjects({user}) {
|
export function MoreProjects({user, minus}) {
|
||||||
const [data, setData] = React.useState(null)
|
const [data, setData] = React.useState(null)
|
||||||
const [error, setError] = React.useState(null)
|
const [error, setError] = React.useState(null)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ export function MoreProjects({user}) {
|
||||||
() => {
|
() => {
|
||||||
if(data === null) return "Loading..."
|
if(data === null) return "Loading..."
|
||||||
else if(error !== null) return "Error: {error}"
|
else if(error !== null) return "Error: {error}"
|
||||||
return `...and ${data["public_repos"]} more!`
|
return `...and ${data["public_repos"] - minus} more!`
|
||||||
},
|
},
|
||||||
[data, error]
|
[data, error]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue