@jeremyckahn/farmhand 1.23.3 → 1.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/assets/index-4ynbl-GC.js +392 -0
- package/dist/assets/index-4ynbl-GC.js.map +1 -0
- package/dist/assets/index-CaYdR-lC.css +1 -0
- package/dist/assets/jersey-10-latin-400-normal-DrL73VYW.woff2 +0 -0
- package/dist/assets/jersey-10-latin-ext-400-normal-uIKqQSaG.woff2 +0 -0
- package/dist/assets/jersey-20-latin-400-normal-bNi78tgO.woff2 +0 -0
- package/dist/assets/jersey-20-latin-ext-400-normal-BO3lmWef.woff2 +0 -0
- package/dist/assets/jersey-25-latin-400-normal-BuYJnnt7.woff2 +0 -0
- package/dist/assets/jersey-25-latin-ext-400-normal-CP5Jl3WN.woff2 +0 -0
- package/dist/index.html +2 -2
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +4 -8
- package/src/components/AccountingView/AccountingView.tsx +3 -1
- package/src/components/Achievement/Achievement.tsx +2 -2
- package/src/components/AppBar/AppBar.tsx +21 -7
- package/src/components/CowCard/Bloodline/Bloodline.tsx +0 -1
- package/src/components/CowCard/CowCard.tsx +7 -13
- package/src/components/CowCard/Subheader/Subheader.tsx +10 -18
- package/src/components/CowPen/Cow.tsx +5 -11
- package/src/components/CowPen/CowPen.test.tsx +4 -4
- package/src/components/CowPen/CowPen.tsx +1 -1
- package/src/components/CowPenContextMenu/CowPenContextMenu.tsx +2 -2
- package/src/components/Farmhand/Farmhand.tsx +7 -4
- package/src/components/Farmhand/useFarmhand.ts +12 -2
- package/src/components/Field/Field.tsx +2 -2
- package/src/components/Home/Home.tsx +2 -1
- package/src/components/Inventory/Inventory.tsx +2 -1
- package/src/components/Item/Item.tsx +11 -8
- package/src/components/LogView/LogView.tsx +6 -22
- package/src/components/Navigation/DayAndProgressContainer.tsx +0 -1
- package/src/components/Navigation/Navigation.tsx +12 -10
- package/src/components/NotificationSystem/NotificationSystem.test.tsx +41 -2
- package/src/components/NotificationSystem/NotificationSystem.tsx +40 -20
- package/src/components/PixelIcon/createPixelIcon.test.tsx +59 -0
- package/src/components/PixelIcon/createPixelIcon.tsx +97 -0
- package/src/components/PixelIcon/icons.ts +445 -0
- package/src/components/PixelIcon/index.ts +3 -0
- package/src/components/ProgressBar/ProgressBar.tsx +9 -3
- package/src/components/QuantityInput/QuantityInput.tsx +6 -2
- package/src/components/SearchBar/SearchBar.tsx +4 -4
- package/src/components/SettingsView/SettingsView.tsx +0 -2
- package/src/components/StatsView/StatsView.tsx +0 -3
- package/src/components/UpdateNotifier/UpdateNotifier.tsx +33 -5
- package/src/farmhand.d.ts +4 -0
- package/src/game-logic/reducers/showNotification.test.ts +20 -0
- package/src/game-logic/reducers/showNotification.ts +4 -2
- package/src/handlers/ui-events.tsx +8 -3
- package/src/index.tsx +0 -2
- package/src/mui-theme.ts +255 -35
- package/src/setupTests.ts +18 -12
- package/src/strings.ts +1 -1
- package/src/styles/fonts.ts +73 -0
- package/src/styles/pixel.ts +151 -0
- package/src/styles/sx.ts +17 -8
- package/src/styles/tokens.ts +11 -0
- package/src/utils/getCowImage.ts +0 -11
- package/dist/assets/francois-one-latin-400-normal-DD1rFI7H.woff2 +0 -0
- package/dist/assets/francois-one-latin-400-normal-DNXs7uOx.woff +0 -0
- package/dist/assets/francois-one-latin-ext-400-normal-CwRdWRZD.woff2 +0 -0
- package/dist/assets/francois-one-latin-ext-400-normal-JvkpT0Av.woff +0 -0
- package/dist/assets/francois-one-vietnamese-400-normal-BLIKeG5Y.woff2 +0 -0
- package/dist/assets/francois-one-vietnamese-400-normal-CuWeHlXs.woff +0 -0
- package/dist/assets/index-CNcrTYN-.css +0 -1
- package/dist/assets/index-Dihg7UqQ.js +0 -844
- package/dist/assets/index-Dihg7UqQ.js.map +0 -1
- package/dist/assets/public-sans-latin-400-normal-8Rpg0ruU.woff2 +0 -0
- package/dist/assets/public-sans-latin-400-normal-SBbinRkI.woff +0 -0
- package/dist/assets/public-sans-latin-ext-400-normal-B02wwOdZ.woff +0 -0
- package/dist/assets/public-sans-latin-ext-400-normal-mk90oQqJ.woff2 +0 -0
- package/dist/assets/public-sans-vietnamese-400-normal-BO1meqcx.woff +0 -0
- package/dist/assets/public-sans-vietnamese-400-normal-TxZB8OSn.woff2 +0 -0
- package/src/fontsource.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--animate-duration:1s;--animate-delay:1s;--animate-repeat:1}.animated{animation-duration:var(--animate-duration);animation-fill-mode:both}.animated.infinite{animation-iteration-count:infinite}.animated.repeat-1{animation-iteration-count:var(--animate-repeat)}.animated.repeat-2{animation-iteration-count:calc(var(--animate-repeat) * 2)}.animated.repeat-3{animation-iteration-count:calc(var(--animate-repeat) * 3)}.animated.delay-1s{animation-delay:var(--animate-delay)}.animated.delay-2s{animation-delay:calc(var(--animate-delay) * 2)}.animated.delay-3s{animation-delay:calc(var(--animate-delay) * 3)}.animated.delay-4s{animation-delay:calc(var(--animate-delay) * 4)}.animated.delay-5s{animation-delay:calc(var(--animate-delay) * 5)}.animated.faster{animation-duration:calc(var(--animate-duration) / 2)}.animated.fast{animation-duration:calc(var(--animate-duration) * .8)}.animated.slow{animation-duration:calc(var(--animate-duration) * 2)}.animated.slower{animation-duration:calc(var(--animate-duration) * 3)}@media print,(prefers-reduced-motion:reduce){.animated{transition-duration:1ms!important;animation-duration:1ms!important;animation-iteration-count:1!important}.animated[class*=Out]{opacity:0}}@keyframes heartBeat{0%{transform:scale(1)}14%{transform:scale(1.3)}28%{transform:scale(1)}42%{transform:scale(1.3)}70%{transform:scale(1)}}.heartBeat{animation-name:heartBeat;animation-duration:calc(var(--animate-duration) * 1.3);animation-timing-function:ease-in-out}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.html
CHANGED
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
gtag('config', analyticsID)
|
|
76
76
|
})()
|
|
77
77
|
</script>
|
|
78
|
-
<script type="module" crossorigin src="./assets/index-
|
|
79
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
78
|
+
<script type="module" crossorigin src="./assets/index-4ynbl-GC.js"></script>
|
|
79
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CaYdR-lC.css">
|
|
80
80
|
<link rel="manifest" href="./manifest.webmanifest"></head>
|
|
81
81
|
<body>
|
|
82
82
|
<noscript>
|
package/dist/service-worker.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let d={};const l=e=>i(e,r),t={module:{uri:r},exports:d,require:l};s[r]=Promise.all(n.map(e=>t[e]||l(e))).then(e=>(o(...e),d))}}define(["./workbox-2fbc6a65"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"
|
|
1
|
+
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,o)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let d={};const l=e=>i(e,r),t={module:{uri:r},exports:d,require:l};s[r]=Promise.all(n.map(e=>t[e]||l(e))).then(e=>(o(...e),d))}}define(["./workbox-2fbc6a65"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"index.html",revision:"722454fd4105f0205fcba60b9eef981e"},{url:"electron.js",revision:"b0456826f47539f6c1957c3add5eb959"},{url:"assets/workbox-window.prod.es5-Bd17z0YL.js",revision:null},{url:"assets/index-CaYdR-lC.css",revision:null},{url:"assets/index-4ynbl-GC.js",revision:null},{url:"favicon.ico",revision:"445bb19d4a8fd46eb433dd43cbdce691"},{url:"logo192.png",revision:"70746d790b8990639d1390337d77d81a"},{url:"logo512.png",revision:"b044ab46b3f33f0e2d313d961bf1f654"},{url:"logoMaskable.png",revision:"23be58ccf16df9f43658aad3da30056d"},{url:"manifest.webmanifest",revision:"3ad071a00582451c9cdeb827b37b9ebe"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
|
|
2
2
|
//# sourceMappingURL=service-worker.js.map
|
|
3
3
|
//# sourceMappingURL=service-worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/
|
|
1
|
+
{"version":3,"file":"service-worker.js","sources":["../../../../../tmp/ddd5756e9844fd752d030ba271838589/service-worker.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';\nimport {registerRoute as workbox_routing_registerRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-routing/registerRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/runner/work/farmhand/farmhand/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"index.html\",\n \"revision\": \"722454fd4105f0205fcba60b9eef981e\"\n },\n {\n \"url\": \"electron.js\",\n \"revision\": \"b0456826f47539f6c1957c3add5eb959\"\n },\n {\n \"url\": \"assets/workbox-window.prod.es5-Bd17z0YL.js\",\n \"revision\": null\n },\n {\n \"url\": \"assets/index-CaYdR-lC.css\",\n \"revision\": null\n },\n {\n \"url\": \"assets/index-4ynbl-GC.js\",\n \"revision\": null\n },\n {\n \"url\": \"favicon.ico\",\n \"revision\": \"445bb19d4a8fd46eb433dd43cbdce691\"\n },\n {\n \"url\": \"logo192.png\",\n \"revision\": \"70746d790b8990639d1390337d77d81a\"\n },\n {\n \"url\": \"logo512.png\",\n \"revision\": \"b044ab46b3f33f0e2d313d961bf1f654\"\n },\n {\n \"url\": \"logoMaskable.png\",\n \"revision\": \"23be58ccf16df9f43658aad3da30056d\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"3ad071a00582451c9cdeb827b37b9ebe\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();workbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"index.html\")));\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","workbox_precaching_cleanupOutdatedCaches","workbox_routing_registerRoute","workbox_routing_NavigationRoute","workbox_precaching_createHandlerBoundToURL"],"mappings":"inBAmBAA,KAAKC,iBAAiB,UAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,gBASTC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,MAEd,CACED,IAAO,4BACPC,SAAY,MAEd,CACED,IAAO,2BACPC,SAAY,MAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,cACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,qCAEb,CAAA,GACHC,EAAAA,wBAA2CC,EAAAA,cAA8B,IAAIC,EAAAA,gBAAgCC,0BAA2C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeremyckahn/farmhand",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -101,13 +101,9 @@
|
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"@emotion/react": "^11.11.1",
|
|
103
103
|
"@emotion/styled": "^11.11.0",
|
|
104
|
-
"@fontsource/
|
|
105
|
-
"@fontsource/
|
|
106
|
-
"@
|
|
107
|
-
"@fortawesome/free-regular-svg-icons": "^5.12.1",
|
|
108
|
-
"@fortawesome/free-solid-svg-icons": "^5.12.1",
|
|
109
|
-
"@fortawesome/react-fontawesome": "^0.1.9",
|
|
110
|
-
"@mui/icons-material": "^5.15.0",
|
|
104
|
+
"@fontsource/jersey-10": "^5.3.0",
|
|
105
|
+
"@fontsource/jersey-20": "^5.3.0",
|
|
106
|
+
"@fontsource/jersey-25": "^5.3.0",
|
|
111
107
|
"@mui/lab": "^5.0.0-alpha.156",
|
|
112
108
|
"@mui/material": "^5.15.0",
|
|
113
109
|
"@mui/styles": "^5.15.0",
|
|
@@ -4,9 +4,11 @@ import CardHeader from '@mui/material/CardHeader/index.js'
|
|
|
4
4
|
import CardContent from '@mui/material/CardContent/index.js'
|
|
5
5
|
import Button from '@mui/material/Button/index.js'
|
|
6
6
|
import TextField from '@mui/material/TextField/index.js'
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
import NumberFormat from 'react-number-format'
|
|
9
9
|
|
|
10
|
+
import { AccountBalanceIcon } from '../PixelIcon/index.js'
|
|
11
|
+
|
|
10
12
|
import FarmhandContext from '../Farmhand/Farmhand.context.js'
|
|
11
13
|
import { moneyString } from '../../utils/moneyString.js'
|
|
12
14
|
import { dollarString } from '../../utils/dollarString.js'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
|
|
4
|
-
import AssignmentLateIcon from '@mui/icons-material/AssignmentLate.js'
|
|
5
4
|
import Card from '@mui/material/Card/index.js'
|
|
6
5
|
import CardHeader from '@mui/material/CardHeader/index.js'
|
|
7
6
|
import CardContent from '@mui/material/CardContent/index.js'
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
import { AssignmentLateIcon, BeenhereIcon } from '../PixelIcon/index.js'
|
|
9
9
|
|
|
10
10
|
import FarmhandContext from '../Farmhand/Farmhand.context.js'
|
|
11
11
|
import { Div } from '../Elements/index.js'
|
|
@@ -5,14 +5,15 @@ import { tween, Tweenable } from 'shifty'
|
|
|
5
5
|
import { default as MuiAppBar } from '@mui/material/AppBar/index.js'
|
|
6
6
|
import Toolbar from '@mui/material/Toolbar/index.js'
|
|
7
7
|
import Typography from '@mui/material/Typography/index.js'
|
|
8
|
-
import StepIcon from '@mui/material/StepIcon/index.js'
|
|
9
8
|
|
|
10
9
|
import FarmhandContext from '../Farmhand/Farmhand.context.js'
|
|
10
|
+
import { WarningIcon } from '../PixelIcon/index.js'
|
|
11
11
|
import { seasonNameMap } from '../../data/seasons.js'
|
|
12
12
|
import { getCurrentSeason } from '../../utils/getCurrentSeason.js'
|
|
13
13
|
import { getDayOfSeason } from '../../utils/getDayOfSeason.js'
|
|
14
14
|
import { moneyString } from '../../utils/moneyString.js'
|
|
15
|
-
import {
|
|
15
|
+
import { pixelBevel, pixelFrameSx } from '../../styles/pixel.js'
|
|
16
|
+
import { breakpoints, colors, fonts } from '../../styles/tokens.js'
|
|
16
17
|
import { usePrefersReducedMotion } from '../../hooks/usePrefersReducedMotion.js'
|
|
17
18
|
|
|
18
19
|
const MoneyDisplay = ({ money }: { money: number }) => {
|
|
@@ -102,7 +103,7 @@ export const AppBar = ({
|
|
|
102
103
|
display: 'flex',
|
|
103
104
|
'& h2': {
|
|
104
105
|
color: '#fff',
|
|
105
|
-
fontFamily:
|
|
106
|
+
fontFamily: fonts.display,
|
|
106
107
|
fontSize: '1.2em',
|
|
107
108
|
},
|
|
108
109
|
'& .stage-header': {
|
|
@@ -129,8 +130,21 @@ export const AppBar = ({
|
|
|
129
130
|
right: '1em',
|
|
130
131
|
},
|
|
131
132
|
'& .notification-indicator-container': {
|
|
133
|
+
alignItems: 'center',
|
|
134
|
+
cursor: 'pointer',
|
|
132
135
|
display: 'flex',
|
|
133
|
-
'& .
|
|
136
|
+
'& .notification-count': {
|
|
137
|
+
...pixelFrameSx({ outline: colors.neutralOutline }),
|
|
138
|
+
backgroundColor: 'rgba(0, 0, 0, 0.38)',
|
|
139
|
+
boxShadow: pixelBevel(),
|
|
140
|
+
color: '#fff',
|
|
141
|
+
fontFamily: fonts.display,
|
|
142
|
+
lineHeight: 1,
|
|
143
|
+
minWidth: '1.5em',
|
|
144
|
+
padding: '0.2em 0.35em',
|
|
145
|
+
textAlign: 'center',
|
|
146
|
+
},
|
|
147
|
+
'& .error-indicator': { display: 'flex', marginLeft: '1em' },
|
|
134
148
|
},
|
|
135
149
|
},
|
|
136
150
|
}}
|
|
@@ -147,8 +161,8 @@ export const AppBar = ({
|
|
|
147
161
|
onClick: handleClickNotificationIndicator,
|
|
148
162
|
}}
|
|
149
163
|
>
|
|
150
|
-
<Typography>
|
|
151
|
-
|
|
164
|
+
<Typography {...{ className: 'notification-count' }}>
|
|
165
|
+
{todaysNotifications.length}
|
|
152
166
|
</Typography>
|
|
153
167
|
{areAnyNotificationsErrors && (
|
|
154
168
|
<Typography
|
|
@@ -156,7 +170,7 @@ export const AppBar = ({
|
|
|
156
170
|
className: 'error-indicator',
|
|
157
171
|
}}
|
|
158
172
|
>
|
|
159
|
-
<
|
|
173
|
+
<WarningIcon {...{ color: 'error' }} />
|
|
160
174
|
</Typography>
|
|
161
175
|
)}
|
|
162
176
|
</div>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { faMars, faVenus } from '@fortawesome/free-solid-svg-icons'
|
|
4
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
5
3
|
import Button from '@mui/material/Button/index.js'
|
|
6
4
|
import Card from '@mui/material/Card/index.js'
|
|
7
5
|
import CardActions from '@mui/material/CardActions/index.js'
|
|
@@ -28,13 +26,14 @@ import { isCowInBreedingPen } from '../../utils/isCowInBreedingPen.js'
|
|
|
28
26
|
import { isInViewport } from '../../utils/isInViewport.js'
|
|
29
27
|
import { A } from '../Elements/index.js'
|
|
30
28
|
import FarmhandContext, { BoundHandlers } from '../Farmhand/Farmhand.context.js'
|
|
29
|
+
import { FemaleIcon, MaleIcon } from '../PixelIcon/index.js'
|
|
31
30
|
|
|
32
31
|
import Subheader from './Subheader/index.js'
|
|
33
32
|
|
|
34
33
|
const genderIcons = {
|
|
35
|
-
[genders.FEMALE as string]:
|
|
36
|
-
[genders.MALE as string]:
|
|
37
|
-
} as Record<string, typeof
|
|
34
|
+
[genders.FEMALE as string]: FemaleIcon,
|
|
35
|
+
[genders.MALE as string]: MaleIcon,
|
|
36
|
+
} as Record<string, typeof FemaleIcon>
|
|
38
37
|
|
|
39
38
|
export interface CowCardProps {
|
|
40
39
|
allowCustomPeerCowNames: farmhand.state['allowCustomPeerCowNames']
|
|
@@ -156,6 +155,8 @@ export const CowCard = ({
|
|
|
156
155
|
}
|
|
157
156
|
}, [isSelected])
|
|
158
157
|
|
|
158
|
+
const GenderIcon = genderIcons[cow.gender]
|
|
159
|
+
|
|
159
160
|
return (
|
|
160
161
|
<>
|
|
161
162
|
<A
|
|
@@ -232,11 +233,7 @@ export const CowCard = ({
|
|
|
232
233
|
) : (
|
|
233
234
|
displayName
|
|
234
235
|
)}{' '}
|
|
235
|
-
<
|
|
236
|
-
{...{
|
|
237
|
-
icon: genderIcons[cow.gender],
|
|
238
|
-
}}
|
|
239
|
-
/>
|
|
236
|
+
<GenderIcon fontSize="inherit" />
|
|
240
237
|
</>
|
|
241
238
|
),
|
|
242
239
|
subheader: (
|
|
@@ -278,7 +275,6 @@ export const CowCard = ({
|
|
|
278
275
|
{canCowBeTradedFor && (
|
|
279
276
|
<Tooltip
|
|
280
277
|
{...{
|
|
281
|
-
arrow: true,
|
|
282
278
|
placement: 'top',
|
|
283
279
|
title: 'The game will be saved when the trade is completed.',
|
|
284
280
|
}}
|
|
@@ -311,7 +307,6 @@ export const CowCard = ({
|
|
|
311
307
|
(cowIdOfferedForTrade === cow.id ? (
|
|
312
308
|
<Tooltip
|
|
313
309
|
{...{
|
|
314
|
-
arrow: true,
|
|
315
310
|
placement: 'top',
|
|
316
311
|
title: WITHDRAW_COW_FROM_TRADE('', cowDisplayName),
|
|
317
312
|
}}
|
|
@@ -332,7 +327,6 @@ export const CowCard = ({
|
|
|
332
327
|
) : (
|
|
333
328
|
<Tooltip
|
|
334
329
|
{...{
|
|
335
|
-
arrow: true,
|
|
336
330
|
placement: 'top',
|
|
337
331
|
title: (
|
|
338
332
|
<Typography>
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { faHeart as faEmptyHeart } from '@fortawesome/free-regular-svg-icons'
|
|
2
|
-
import { faHeart as faFullHeart } from '@fortawesome/free-solid-svg-icons'
|
|
3
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
4
1
|
import Checkbox from '@mui/material/Checkbox/index.js'
|
|
5
2
|
import FormControlLabel from '@mui/material/FormControlLabel/index.js'
|
|
6
3
|
import Tooltip from '@mui/material/Tooltip/index.js'
|
|
@@ -18,6 +15,7 @@ import { isCowInBreedingPen } from '../../../utils/isCowInBreedingPen.js'
|
|
|
18
15
|
import { memoize } from '../../../utils/memoize.js'
|
|
19
16
|
import { moneyString } from '../../../utils/moneyString.js'
|
|
20
17
|
import { nullArray } from '../../../utils/nullArray.js'
|
|
18
|
+
import { HeartIcon, HeartOutlineIcon } from '../../PixelIcon/index.js'
|
|
21
19
|
import Bloodline from '../Bloodline/index.js'
|
|
22
20
|
import { CowCardProps } from '../CowCard.js'
|
|
23
21
|
|
|
@@ -114,25 +112,20 @@ const Subheader = ({
|
|
|
114
112
|
<ol className="hearts">
|
|
115
113
|
{nullArray(10).map((_null: null, i: number) => (
|
|
116
114
|
<li key={`${cow.id}_${i}`}>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
'is-full': isHeartFull(i, numberOfFullHearts),
|
|
127
|
-
}),
|
|
128
|
-
}}
|
|
129
|
-
/>
|
|
115
|
+
{isHeartFull(i, numberOfFullHearts) ? (
|
|
116
|
+
<HeartIcon
|
|
117
|
+
className="heart is-full"
|
|
118
|
+
fontSize="inherit"
|
|
119
|
+
htmlColor={colors.heart}
|
|
120
|
+
/>
|
|
121
|
+
) : (
|
|
122
|
+
<HeartOutlineIcon className="heart" fontSize="inherit" />
|
|
123
|
+
)}
|
|
130
124
|
</li>
|
|
131
125
|
))}
|
|
132
126
|
</ol>
|
|
133
127
|
<Tooltip
|
|
134
128
|
{...{
|
|
135
|
-
arrow: true,
|
|
136
129
|
placement: 'top',
|
|
137
130
|
title: (
|
|
138
131
|
<Typography>
|
|
@@ -163,7 +156,6 @@ const Subheader = ({
|
|
|
163
156
|
</Tooltip>
|
|
164
157
|
<Tooltip
|
|
165
158
|
{...{
|
|
166
|
-
arrow: true,
|
|
167
159
|
placement: 'top',
|
|
168
160
|
disableFocusListener: disableBreedingControlTooltip,
|
|
169
161
|
disableHoverListener: disableBreedingControlTooltip,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { faHeart } from '@fortawesome/free-solid-svg-icons'
|
|
2
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
1
|
import Tooltip from '@mui/material/Tooltip/index.js'
|
|
4
2
|
import Typography from '@mui/material/Typography/index.js'
|
|
5
3
|
import classNames from 'classnames'
|
|
@@ -12,6 +10,7 @@ import { LEFT, RIGHT } from '../../constants.js'
|
|
|
12
10
|
import { pixel } from '../../img/index.js'
|
|
13
11
|
import { getCowDisplayName } from '../../utils/getCowDisplayName.js'
|
|
14
12
|
import { getCowImage } from '../../utils/getCowImage.js'
|
|
13
|
+
import { HeartIcon } from '../PixelIcon/index.js'
|
|
15
14
|
|
|
16
15
|
// Only moves the cow within the middle 80% of the pen
|
|
17
16
|
const randomPosition = () => 10 + random() * 80
|
|
@@ -249,7 +248,6 @@ export const Cow = ({
|
|
|
249
248
|
)}
|
|
250
249
|
<Tooltip
|
|
251
250
|
{...{
|
|
252
|
-
arrow: true,
|
|
253
251
|
placement: 'top',
|
|
254
252
|
title: <Typography>{cowDisplayName}</Typography>,
|
|
255
253
|
open: isSelected,
|
|
@@ -265,12 +263,12 @@ export const Cow = ({
|
|
|
265
263
|
}}
|
|
266
264
|
alt={cowDisplayName}
|
|
267
265
|
/>
|
|
268
|
-
<
|
|
266
|
+
<HeartIcon
|
|
269
267
|
{...{
|
|
270
|
-
className: classNames('animation', {
|
|
268
|
+
className: classNames('heart-icon', 'animation', {
|
|
271
269
|
'is-animating': showHugAnimation,
|
|
272
270
|
}),
|
|
273
|
-
|
|
271
|
+
fontSize: 'inherit',
|
|
274
272
|
}}
|
|
275
273
|
/>
|
|
276
274
|
</div>
|
|
@@ -278,11 +276,7 @@ export const Cow = ({
|
|
|
278
276
|
<ol {...{ className: 'happiness-boosts-today' }}>
|
|
279
277
|
{new Array(cow.happinessBoostsToday).fill(undefined).map((_, i) => (
|
|
280
278
|
<li {...{ key: i }}>
|
|
281
|
-
<
|
|
282
|
-
{...{
|
|
283
|
-
icon: faHeart,
|
|
284
|
-
}}
|
|
285
|
-
/>
|
|
279
|
+
<HeartIcon className="heart-icon" fontSize="inherit" />
|
|
286
280
|
</li>
|
|
287
281
|
))}
|
|
288
282
|
</ol>
|
|
@@ -94,7 +94,7 @@ describe('Cow', () => {
|
|
|
94
94
|
|
|
95
95
|
render(<Cow {...defaultCowProps} cow={happyCow} />)
|
|
96
96
|
|
|
97
|
-
expect(document.querySelector('.
|
|
97
|
+
expect(document.querySelector('.heart-icon')).toBeInTheDocument()
|
|
98
98
|
})
|
|
99
99
|
|
|
100
100
|
test('does not show happiness indicator when cow is not happy', () => {
|
|
@@ -214,7 +214,7 @@ describe('Cow', () => {
|
|
|
214
214
|
/>
|
|
215
215
|
)
|
|
216
216
|
|
|
217
|
-
const heart = () => container.querySelector('.
|
|
217
|
+
const heart = () => container.querySelector('.heart-icon.animation')
|
|
218
218
|
|
|
219
219
|
rerender(
|
|
220
220
|
<Cow
|
|
@@ -234,7 +234,7 @@ describe('Cow', () => {
|
|
|
234
234
|
/>
|
|
235
235
|
)
|
|
236
236
|
|
|
237
|
-
const heart = () => container.querySelector('.
|
|
237
|
+
const heart = () => container.querySelector('.heart-icon.animation')
|
|
238
238
|
|
|
239
239
|
rerender(
|
|
240
240
|
<Cow
|
|
@@ -258,7 +258,7 @@ describe('Cow', () => {
|
|
|
258
258
|
/>
|
|
259
259
|
)
|
|
260
260
|
|
|
261
|
-
const heart = () => container.querySelector('.
|
|
261
|
+
const heart = () => container.querySelector('.heart-icon.animation')
|
|
262
262
|
|
|
263
263
|
// Midnight: the daily reset brings the boost count back down.
|
|
264
264
|
rerender(
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward.js'
|
|
2
|
-
import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward.js'
|
|
3
1
|
import Fab from '@mui/material/Fab/index.js'
|
|
4
2
|
import MenuItem from '@mui/material/MenuItem/index.js'
|
|
5
3
|
import Select from '@mui/material/Select/index.js'
|
|
@@ -8,6 +6,8 @@ import Tabs from '@mui/material/Tabs/index.js'
|
|
|
8
6
|
import sortBy from 'lodash.sortby'
|
|
9
7
|
import { useEffect, useState } from 'react'
|
|
10
8
|
|
|
9
|
+
import { ArrowDownwardIcon, ArrowUpwardIcon } from '../PixelIcon/index.js'
|
|
10
|
+
|
|
11
11
|
import { PURCHASEABLE_COW_PENS } from '../../constants.js'
|
|
12
12
|
import cowShopInventory from '../../data/shop-inventory-cow.js'
|
|
13
13
|
import uiEventHandlers from '../../handlers/ui-events.js'
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import HotelIcon from '@mui/icons-material/Hotel.js'
|
|
2
|
-
import KeyboardArrowLeft from '@mui/icons-material/KeyboardArrowLeft.js'
|
|
3
|
-
import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight.js'
|
|
4
|
-
import MenuIcon from '@mui/icons-material/Menu.js'
|
|
5
1
|
import CssBaseline from '@mui/material/CssBaseline/index.js'
|
|
6
2
|
import Drawer from '@mui/material/Drawer/index.js'
|
|
7
3
|
import Fab from '@mui/material/Fab/index.js'
|
|
@@ -14,6 +10,13 @@ import { SnackbarProvider } from 'notistack'
|
|
|
14
10
|
import { GlobalHotKeys } from 'react-hotkeys'
|
|
15
11
|
import { Redirect } from 'react-router-dom'
|
|
16
12
|
|
|
13
|
+
import {
|
|
14
|
+
HotelIcon,
|
|
15
|
+
KeyboardArrowLeftIcon as KeyboardArrowLeft,
|
|
16
|
+
KeyboardArrowRightIcon as KeyboardArrowRight,
|
|
17
|
+
MenuIcon,
|
|
18
|
+
} from '../PixelIcon/index.js'
|
|
19
|
+
|
|
17
20
|
import { Z_INDEX } from '../../constants.js'
|
|
18
21
|
import theme, { blueStripeBg } from '../../mui-theme.js'
|
|
19
22
|
import { Div } from '../Elements/index.js'
|
|
@@ -394,8 +394,18 @@ export const useFarmhand = (props: FarmhandProps) => {
|
|
|
394
394
|
boundReducersRef.current.purchaseItem(item, quantity),
|
|
395
395
|
sellItem: (item: any, quantity: number) =>
|
|
396
396
|
boundReducersRef.current.sellItem(item, quantity),
|
|
397
|
-
showNotification: (
|
|
398
|
-
|
|
397
|
+
showNotification: (
|
|
398
|
+
msg: string,
|
|
399
|
+
sev?: string,
|
|
400
|
+
onClick?: () => void,
|
|
401
|
+
actionLabel?: string
|
|
402
|
+
) =>
|
|
403
|
+
boundReducersRef.current.showNotification(
|
|
404
|
+
msg,
|
|
405
|
+
sev,
|
|
406
|
+
onClick,
|
|
407
|
+
actionLabel
|
|
408
|
+
),
|
|
399
409
|
prependPendingPeerMessage: (msg: string, sev?: string) =>
|
|
400
410
|
boundReducersRef.current.prependPendingPeerMessage(msg, sev),
|
|
401
411
|
forRange: (
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import ZoomInIcon from '@mui/icons-material/ZoomIn.js'
|
|
2
|
-
import ZoomOutIcon from '@mui/icons-material/ZoomOut.js'
|
|
3
1
|
import Fab from '@mui/material/Fab/index.js'
|
|
4
2
|
import FormControl from '@mui/material/FormControl/index.js'
|
|
5
3
|
import FormControlLabel from '@mui/material/FormControlLabel/index.js'
|
|
@@ -14,6 +12,8 @@ import React, { memo, useEffect, useState } from 'react'
|
|
|
14
12
|
import { GlobalHotKeys } from 'react-hotkeys'
|
|
15
13
|
import { TransformComponent, TransformWrapper } from 'react-zoom-pan-pinch'
|
|
16
14
|
|
|
15
|
+
import { ZoomInIcon, ZoomOutIcon } from '../PixelIcon/index.js'
|
|
16
|
+
|
|
17
17
|
import {
|
|
18
18
|
basicLightningRod,
|
|
19
19
|
superiorLightningRod,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore.js'
|
|
2
1
|
import Accordion from '@mui/material/Accordion/index.js'
|
|
3
2
|
import AccordionDetails from '@mui/material/AccordionDetails/index.js'
|
|
4
3
|
import AccordionSummary from '@mui/material/AccordionSummary/index.js'
|
|
@@ -9,6 +8,8 @@ import Divider from '@mui/material/Divider/index.js'
|
|
|
9
8
|
import globalWindow from 'global/window.js'
|
|
10
9
|
import ReactMarkdown from 'react-markdown'
|
|
11
10
|
|
|
11
|
+
import { ExpandMoreIcon } from '../PixelIcon/index.js'
|
|
12
|
+
|
|
12
13
|
import { items } from '../../img/index.js'
|
|
13
14
|
|
|
14
15
|
import { STANDARD_LOAN_AMOUNT } from '../../constants.js'
|
|
@@ -4,7 +4,8 @@ import AccordionSummary from '@mui/material/AccordionSummary/index.js'
|
|
|
4
4
|
import AccordionDetails from '@mui/material/AccordionDetails/index.js'
|
|
5
5
|
import Checkbox from '@mui/material/Checkbox/index.js'
|
|
6
6
|
import FormControlLabel from '@mui/material/FormControlLabel/index.js'
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { ExpandMoreIcon } from '../PixelIcon/index.js'
|
|
8
9
|
|
|
9
10
|
import FarmhandContext, { ContextData } from '../Farmhand/Farmhand.context.js'
|
|
10
11
|
import Item from '../Item/index.js'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
import KeyboardArrowDown from '@mui/icons-material/KeyboardArrowDown.js'
|
|
2
|
+
|
|
4
3
|
import Button from '@mui/material/Button/index.js'
|
|
5
4
|
import Box from '@mui/material/Box/index.js'
|
|
6
5
|
import Card from '@mui/material/Card/index.js'
|
|
@@ -11,6 +10,11 @@ import Tooltip from '@mui/material/Tooltip/index.js'
|
|
|
11
10
|
import Typography from '@mui/material/Typography/index.js'
|
|
12
11
|
import classNames from 'classnames'
|
|
13
12
|
|
|
13
|
+
import {
|
|
14
|
+
KeyboardArrowUpIcon as KeyboardArrowUp,
|
|
15
|
+
KeyboardArrowDownIcon as KeyboardArrowDown,
|
|
16
|
+
} from '../PixelIcon/index.js'
|
|
17
|
+
|
|
14
18
|
import FarmhandContext, { ContextData } from '../Farmhand/Farmhand.context.js'
|
|
15
19
|
import { items } from '../../img/index.js'
|
|
16
20
|
import { itemsMap } from '../../data/maps.js'
|
|
@@ -35,18 +39,20 @@ interface ValueIndicatorProps {
|
|
|
35
39
|
poorValue: boolean
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
// Keeps the indicator from crowding the price it follows.
|
|
43
|
+
const valueIndicatorSx = { marginLeft: '0.5rem' } as const
|
|
44
|
+
|
|
38
45
|
const ValueIndicator = ({ poorValue }: ValueIndicatorProps) => (
|
|
39
46
|
<Tooltip
|
|
40
47
|
{...{
|
|
41
|
-
arrow: true,
|
|
42
48
|
placement: 'top',
|
|
43
49
|
title: `${poorValue ? 'Poor' : 'Good'} opportunity`,
|
|
44
50
|
}}
|
|
45
51
|
>
|
|
46
52
|
{poorValue ? (
|
|
47
|
-
<KeyboardArrowDown color="error" />
|
|
53
|
+
<KeyboardArrowDown color="error" sx={valueIndicatorSx} />
|
|
48
54
|
) : (
|
|
49
|
-
<KeyboardArrowUp color="primary" />
|
|
55
|
+
<KeyboardArrowUp color="primary" sx={valueIndicatorSx} />
|
|
50
56
|
)}
|
|
51
57
|
</Tooltip>
|
|
52
58
|
)
|
|
@@ -228,7 +234,6 @@ export const Item = ({
|
|
|
228
234
|
!isPurchaseView && description ? (
|
|
229
235
|
<Tooltip
|
|
230
236
|
{...{
|
|
231
|
-
arrow: true,
|
|
232
237
|
placement: 'top',
|
|
233
238
|
title: <Typography>{description}</Typography>,
|
|
234
239
|
}}
|
|
@@ -245,7 +250,6 @@ export const Item = ({
|
|
|
245
250
|
<p>
|
|
246
251
|
<Tooltip
|
|
247
252
|
{...{
|
|
248
|
-
arrow: true,
|
|
249
253
|
placement: 'top',
|
|
250
254
|
title:
|
|
251
255
|
previousDayAdjustedValue === null
|
|
@@ -287,7 +291,6 @@ export const Item = ({
|
|
|
287
291
|
<p>
|
|
288
292
|
<Tooltip
|
|
289
293
|
{...{
|
|
290
|
-
arrow: true,
|
|
291
294
|
placement: 'top',
|
|
292
295
|
title:
|
|
293
296
|
previousDayAdjustedValue === null
|
|
@@ -6,6 +6,7 @@ import Divider from '@mui/material/Divider/index.js'
|
|
|
6
6
|
|
|
7
7
|
import FarmhandContext from '../Farmhand/Farmhand.context.js'
|
|
8
8
|
import { Div } from '../Elements/index.js'
|
|
9
|
+
import { NotificationAlert } from '../NotificationSystem/NotificationSystem.js'
|
|
9
10
|
|
|
10
11
|
export const LogView = ({
|
|
11
12
|
notificationLog,
|
|
@@ -23,28 +24,11 @@ export const LogView = ({
|
|
|
23
24
|
>
|
|
24
25
|
<h3>Today</h3>
|
|
25
26
|
<ul>
|
|
26
|
-
{todaysNotifications.map(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}: farmhand.notification & { onClick?: () => void }) => (
|
|
32
|
-
<li {...{ key: message }}>
|
|
33
|
-
<Alert
|
|
34
|
-
{...{
|
|
35
|
-
elevation: 3,
|
|
36
|
-
onClick,
|
|
37
|
-
severity,
|
|
38
|
-
style: {
|
|
39
|
-
cursor: onClick ? 'pointer' : 'default',
|
|
40
|
-
},
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
<ReactMarkdown {...{ source: message }} />
|
|
44
|
-
</Alert>
|
|
45
|
-
</li>
|
|
46
|
-
)
|
|
47
|
-
)}
|
|
27
|
+
{todaysNotifications.map(notification => (
|
|
28
|
+
<li {...{ key: notification.message }}>
|
|
29
|
+
<NotificationAlert {...{ notification }} />
|
|
30
|
+
</li>
|
|
31
|
+
))}
|
|
48
32
|
</ul>
|
|
49
33
|
<Divider />
|
|
50
34
|
<ul>
|