add ability to re-enter share screen

This commit is contained in:
devang
2022-01-25 23:33:55 -05:00
parent 22b6d50e66
commit 73c3d960db
4 changed files with 24 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import words from './data/words'
import { useLocalStorage } from './hooks/useLocalStorage'
import { ReactComponent as Info } from './data/Info.svg'
import { ReactComponent as Settings } from './data/Settings.svg'
import { ReactComponent as Share } from './data/Share.svg'
import { InfoModal } from './components/InfoModal'
import { SettingsModal } from './components/SettingsModal'
@@ -433,6 +434,9 @@ function App() {
<h1 className={"flex-1 text-center text-l xxs:text-xl -mr-6 sm:text-3xl tracking-wide font-bold font-og"}>
WORDLE ARCHIVE {day} {header_symbol}
</h1>
<button className="mr-2" type="button" onClick={() => setIsOpen(true)}>
<Share />
</button>
<button type="button" onClick={() => setInfoModalIsOpen(true)}>
<Info />
</button>
@@ -565,6 +569,9 @@ function App() {
<h1 className={"flex-1 text-center text-xl xxs:text-2xl -mr-6 sm:text-4xl tracking-wide font-bold font-og"}>
WORDLE ARCHIVE {day} {header_symbol}
</h1>
<button className="mr-6" type="button" onClick={() => setIsOpen(true)}>
<Share />
</button>
<button type="button" onClick={() => setInfoModalIsOpen(true)}>
<Info />
</button>

View File

@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react'
import { status } from '../constants'
import Success from '../data/Success.png'
import Fail from '../data/Cross.png'
import WIP from '../data/WIP3.png'
Modal.setAppElement('#root')
@@ -140,6 +141,19 @@ export const EndGameModal = ({
</div>
</>
)}
{gameState === state.playing && (
<>
<img src={WIP} alt="keep playing" height="auto" width="80%" />
<div className="text-primary dark:text-primary-dark text-4xl text-center">
<p className="mt-3 text-2xl">
Won: {wins}
</p>
<p className="mt-3 text-2xl">
Lost: {losses}
</p>
</div>
</>
)}
<ShareButton />
<CloseButton />
</div>

3
src/data/Share.svg Normal file
View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="currentColor" viewBox="0 0 30 30" stroke="none">
<path d="M 23 3 A 4 4 0 0 0 19 7 A 4 4 0 0 0 19.09375 7.8359375 L 10.011719 12.376953 A 4 4 0 0 0 7 11 A 4 4 0 0 0 3 15 A 4 4 0 0 0 7 19 A 4 4 0 0 0 10.013672 17.625 L 19.089844 22.164062 A 4 4 0 0 0 19 23 A 4 4 0 0 0 23 27 A 4 4 0 0 0 27 23 A 4 4 0 0 0 23 19 A 4 4 0 0 0 19.986328 20.375 L 10.910156 15.835938 A 4 4 0 0 0 11 15 A 4 4 0 0 0 10.90625 14.166016 L 19.988281 9.625 A 4 4 0 0 0 23 11 A 4 4 0 0 0 27 7 A 4 4 0 0 0 23 3 z"/>
</svg>

After

Width:  |  Height:  |  Size: 553 B

BIN
src/data/WIP3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB