Skip to content

Commit

Permalink
Showed box shadow on winner
Browse files Browse the repository at this point in the history
  • Loading branch information
florianstancioiu committed Nov 4, 2023
1 parent 9402c49 commit 2a314a5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
14 changes: 12 additions & 2 deletions src/components/GameResult.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ const GameResult = () => {
(state) => state.game.currentGame.playerChoice
);
const pcChoice = useSelector((state) => state.game.currentGame.pcChoice);
const playerWinner = useSelector(
(state) => state.game.currentGame.playerWinner
);

const playerWinnerBorderClasses = playerWinner
? 'rounded-full shadow-winner'
: '';
const pcWinnerBorderClasses = !playerWinner
? 'rounded-full shadow-winner'
: '';

return (
<div>
Expand All @@ -18,7 +28,7 @@ const GameResult = () => {
<p className='text-white uppercase text-[24px] leading-[32px] hidden md:block mb-[63px]'>
You picked
</p>
<div className='rounded-full shadow-winner'>
<div className={playerWinnerBorderClasses}>
{playerChoice === 'rock' && (
<img
className='block mx-auto mb-[17px] w-[130px] md:w-[293px]'
Expand Down Expand Up @@ -51,7 +61,7 @@ const GameResult = () => {
<p className='text-white uppercase text-[24px] leading-[32px] hidden md:block mb-[63px]'>
The house picked
</p>
<div className='rounded-full shadow-winner'>
<div className={pcWinnerBorderClasses}>
{pcChoice === 'scissors' && (
<img
className='block mx-auto mb-[17px] w-[130px] md:w-[293px]'
Expand Down
2 changes: 1 addition & 1 deletion src/components/UI/Btn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Btn = ({ title, onClick }) => {
return (
<button
onClick={onClick}
className='block mx-auto uppercase text-white text-[16px] border-white border-[1px] rounded-[8px] py-[10px] px-[36px] md:float-right'
className='block mx-auto uppercase text-white text-[16px] border-white border-[1px] rounded-[8px] py-[10px] px-[36px] md:absolute md:bottom-[20px] md:right-[20px] hover:bg-white hover:text-rules'
>
{title}
</button>
Expand Down
10 changes: 5 additions & 5 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import App from './App.jsx';
import './index.css';
import store from './store';

// <React.StrictMode>

ReactDOM.createRoot(document.getElementById('root')).render(
<Provider store={store}>
<App />
</Provider>
<React.StrictMode>
<Provider store={store}>
<App />
</Provider>
</React.StrictMode>
);

0 comments on commit 2a314a5

Please sign in to comment.