Skip to content

Commit

Permalink
Update URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
NalimWeso committed Apr 3, 2024
1 parent 0ab7cf7 commit e70f0ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/components/Picker.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useRef } from "react"
import { useNavigate } from 'react-router-dom'
import arrayShuffle from 'array-shuffle'

function Picker() {
Expand All @@ -7,6 +8,7 @@ function Picker() {
const [buttonDisabled, setButtonDisabled] = useState(false);
const buttonRef = useRef();
const imgRef = useRef();
const navigate = useNavigate();
let images = [];

document.body.style.backgroundImage = 'url("src/images/backgrounds/BackgroundPicker.jpg")';
Expand Down Expand Up @@ -62,15 +64,15 @@ function Picker() {
});
}

function end() {
window.location.href = '/hoodie-color-picker/';
function clickEnd() {
navigate('/');
}

return (
<div className="picker">
<img src={`src/images/hoodies/${hoodieImage}.jpg`} alt={`Hoodie no. ${hoodieImage}.`} ref={imgRef} />
<button onClick={generateNumber} ref={buttonRef} disabled={buttonDisabled}>CHOOSE RANDOM COLOR</button>
<button onClick={end}>BACK TO MAIN PAGE</button>
<button onClick={clickEnd}>BACK TO MAIN PAGE</button>
</div>
)
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/Start.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { useNavigate } from 'react-router-dom'

function Start() {
const navigate = useNavigate();

document.body.style.backgroundImage = 'url("src/images/backgrounds/BackgroundStart.jpg")';

function clickStart() {
window.location.href = '/hoodie-color-picker/picker';
navigate('/picker');
}

return (
Expand Down

0 comments on commit e70f0ce

Please sign in to comment.