Skip to content

Commit 97acdf9

Browse files
committed
Remove unneeded variables: use configuration
Instead of sticking configuration.abbr in local variables of acnw and acus, which are essentially inverted Boolean flags, check against its values of 'acus' or 'acnw' directly. It's simpler, clearer, and allows for adding a third (even if only synthetic) site. Resolves: #155, #158, #160, #161 See also: #159
1 parent 90c6a4b commit 97acdf9

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

packages/amber/components/Footer.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export const Footer: React.FC = (_props) => {
5555
const commitDate = DateTime.fromISO(gitHash.date)
5656
const id = open ? 'simple-popover' : undefined
5757
const configuration = useConfiguration()
58-
const copyrightUrl = configuration.copyright
5958
return (
6059
<Box
6160
component='footer'
@@ -97,7 +96,7 @@ export const Footer: React.FC = (_props) => {
9796
<Box component='span' sx={{ cursor: 'pointer' }} onClick={handleClick}>
9897
{hash}
9998
</Box>{' '}
100-
| &copy; {DateTime.fromJSDate(new Date()).year} {copyrightUrl}
99+
| &copy; {DateTime.fromJSDate(new Date()).year} {configuration.copyright}
101100
</Box>
102101
</Box>
103102
)

packages/amber/views/GmPage/GmPage.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ const VirtualGmBlurb = () => {
128128
const GmBlurb = () => {
129129
const { classes } = useStyles()
130130
const configuration = useConfiguration()
131-
const acus = configuration.abbr === 'acus'
132-
const acnw = !acus
133131
return (
134132
<>
135133
<p>
@@ -141,7 +139,7 @@ const GmBlurb = () => {
141139
</p>
142140
<ol className={classes.blurb}>
143141
<li>
144-
{acnw && (
142+
{configuration.abbr === 'acnw' && (
145143
<p>
146144
<strong>Non-Amber Games</strong>: We encourage people to be creative with the diceless format. If you have
147145
a game that uses a form of the basic Amber DRPG rules but is not set in Amber, you are welcome to post the
@@ -151,7 +149,7 @@ const GmBlurb = () => {
151149
familiarity and interest in the setting.
152150
</p>
153151
)}
154-
{acus && (
152+
{configuration.abbr === 'acus' && (
155153
<p>
156154
<strong>Non-Amber or non-Diceless Games</strong>: We encourage you to be creative and run games that are
157155
fun for you. We welcome a wide variety of games and settings. If you like to run it, chances are, we'll
@@ -198,7 +196,7 @@ const GmBlurb = () => {
198196
do.
199197
</p>
200198
</li>
201-
{acus && (
199+
{configuration.abbr === 'acus' && (
202200
<li>
203201
<p>
204202
<strong>Minimum Number of Players</strong>: We no longer accept games that require more than three

packages/amber/views/Payment/Payment.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ export const Payment: React.FC = () => {
3434
// console.log('Payment', { paymentIntent })
3535

3636
const configuration = useConfiguration()
37-
const acus = configuration.abbr === 'acus'
38-
const acnw = !acus
3937

4038
return (
4139
<Page title='Make Payment'>
@@ -57,7 +55,7 @@ export const Payment: React.FC = () => {
5755
) : (
5856
<Loader />
5957
)}
60-
{acnw && balance < 0 ? (
58+
{configuration.abbr === 'acnw' && balance < 0 ? (
6159
<>
6260
<DialogContentText sx={{ pt: 2 }}>
6361
Alternatively, write a check for <strong>${Math.max(0 - balance, 0)}</strong> made out to{' '}

0 commit comments

Comments
 (0)