hensei-web/components/about/AboutPage/index.tsx
Justin Edmund 9c3c36e81b
Migrate to CSS modules (#335) (#336)
* Modify next.js to re-enable CSS modules

* Rename all files and fix imports

* Renaming index.scss files to index.module.scss
* Changing `import from` to `import styles from`

* Fix dialog styles

* Fix button styles

* Fix dropdown styles

* Fix overlay styles

* Fix segmented control styles

* Fix auth modals

* Fix input styles

* Fix grid rep styles

* Extract language switch component

* Fix party header styles

* Fix header styles

* Fix filter bar styles

* Fix token styles

* Remove tag style from globals

This moved to DropdownMenuItem as thats the only place it's currently used

* Add some shades of purple

* Fix tooltip styles

* Fix star styles

* Fix unit styles

* Fix grid styles

* Fix job styles

* Combine Input and CharLimitedFieldset

We fixed the input component and added a character counter to it, so we don't need a separate CharLimitedFieldSet anymore.

The input component has been simplified to *just* be an input component, so it no longer displays an error. We will make a new component for error handling and labeling. It will probably be an improvement on our custom Fieldset somehow.

* (WIP) Update auth modals for new Input

These rely on error handling and so will need to be fixed more in the future

* Clean up button component some more

Here we add a floating prop for displaying buttons on top of things, like in units. We also renamed contained to bound to match other components and added an icon size.

* Fix styles for perpetuity icon overlay

* Update units for floating button display

* Fix weapon skill overlay

* Add a specific variable for the save UI red

* Fix save button states

* Update raid combobox triggers

* Fix segmented controls

* Fix popover triggers

This is mostly a duplicate of SelectTrigger but CSS modules are deeply stupid, so we have to duplicate the code.

* Fix select classes

* Fix select item classes

* Fix context menus

* Remove console.log

* Update filter bar button

* Updated Select and SelectItem

Part of this was combining PictureSelectItem and SelectItem, so the former has been removed.

* Updated TableField and SelectTableField

* Updated toasts

* Updated AccountModal

* Added new themes and variables

* Fix hovercards

* Extracted header into HovercardHeader component

* Button improvements

* Allow for passing className to left and right accessory
* Rename contained to bound
* Rename buttonSize to size
* Add custom button styles

* Fix search filters

* Update styles for all search filters
* Make search filters function better on mobile
* Small refactor on individual filter bar files to extract individual search filter rendering into variables

* Update search modal styles

* Update input

Make a consistent height with select triggers and fix props

* Fix ExtraSummons and rename to ExtraSummonsGrid

* Fix search result item styles

* Update party footer

* Add segmented control to swap between remixes and description
* Fix styles

* Add local transition to overlay

* Pass down class name to Popover

* Other style changes for raid combobox
* Local keyframe animation

* Fix slider and switch components

* Update table field components

The structure of TableField's image props have changed

* Update PartyHeader and DropdownMenuItem

* Remove extraneous states and hooks from PartyHeader
* Only show PartyDropdown if we are looking at an existing party
* Add destructive prop for DropdownMenuItem
* Remove extraneous classes from PartyDropdown
* Localize dropdown contents

* Fix alert styles and overlays

* Update alert styles
* Fix Overlay component to take onClick event handler as a prop

* Add local animation to Tooltip

* Update GridRep

* Update job-related components

* Update select component

* Align the popover
* Pass down classes from props
* Adds local animation
* Remove modal style
* Add full width style

* Update RaidCombobox and RaidItem

Also removes RaidSelect, which has been removed

* Update object reps for mobile

* Update static pages

* Update extra weapons section

* ExtraContainer split into ExtraContainerItem
* Updated Guidebook result item, grid and unit
* Updated extra weapons grid and weapon grid

* Add missing animations to Toast

* Moved components to a new filters folder

* Fix Youtube and empty state in PartyFooter

* Fixed Youtube embed styles
* Added empty state for description tab

* Extracted filter bar user info into a new component

* Removed LabelledInput

* Added new Textarea component

This is a content editable div to prepare for when we add tagging and formatting

* Fix placeholders in SummonUnit

* Add extra colors to WeaponUnit

* Updated WeaponLabelIcon styles

* Update button prop labels

* Update auth components

Just moving import order and changing an unused class name

* Increase visibility of segmented control on static page

* Update FilterBar location and more

* Updates FilterBar import location
* Extracts user info into UserInfo component

* Update localizations

* Update button prop labels

* Update UncapIndicator display styles

* Update ExtraSummons to ExtraSummonsGrid

* Use small-tablet breakpoint for party reps

* Update Input and InputTableField

* Added error and label to input, in a fieldset
* Updated prop labels in InputTableField

* Center text on triggers on small screen sizes

* Update SelectGroup styles

* Update GridRep

* Remove link to user's profile—it was very distracting
* Increase mainhand max height so it doesn't appear too small when reps are larger

* Update SegmentedControl

* Forward refs to SegmentedControl
* Allow passing of className via props
* Specific styles for RaidCombobox and something else
* Use small-tablet breakpoint

* Update Segment styles

Notably, there's a nice transition now

* Remove unused style import

* Add custom Button styles

* Update proficiency typing

* Update PartyHeader and fix behavior

* Send true to editable prop is party is editable
* Fix turn count token display
* Fix party name style
* Add custom classes to various Buttons
* Only show PartyDropdown if a party is new
* Determine which buttons to show based on editable prop, not snapshot
* Remove unused code from Header
* Make new button route shallowly

* Add small-tablet breakpoint

* Update themes and variables

* Update globals.scss

* Don't show <img> when there is no icon

* Add prop for destructive dropdown menu items

* Update localizations

* Remove unused code

Dependencies and components that were no longer used

* Add lodash.isequal

We didn't end up using it but it might come in handy in the future

* Add custom styles for remixed pill

This pill displays when a party is a remix. We shrunk it so it wasn't quite the size of a normal small button, and then added disabled states for if the original party was deleted

* Use CSS modules with Command

We don't really use all of these exports, but we made it so that className gets passed properly to `styles` when we do

* Update DialogContent

* Shrunk max-height to 60vh, and remove it for search
* Added an explicit width, as using min/max-width interferes with the contentEditable div in EditPartyModal
* Added custom styles for EditPartyModal
* Removed unused styles

* Revert Command changes

This seems to rely on these specific styles and it works, so we'll leave it alone for now.

* Give visual focus state to close button

* Update DurationInput and remove old classes

* Update Input

* Add fieldsetClasses prop
* Fallback to an empty string if value is undefined
* Fix focus ring to be consistent with our other custom focus rings
* Fix placeholder color

* Hide text overflow in trigger

The Popover trigger (specifically for RaidCombobox) would stretch or break lines when given a long value. This makes it so that the text will always stay on one line and hide its overflow with an ellipsis if necessary

* Passes along the autoFocus prop to Select

This passes along the autoFocus prop to the root Select component, and exposes it in SelectTableField

* Fixes bug with SliderTablefield control

This fixes a bug where the SliderTableField's slider was not changing the input's value.

We essentially let the parent component control the value so the component is only ever reading from props, instead of using its stored state as a display.

* Fix placeholder text and formatting

This fixes Textarea's placeholder text to be consistent with Input, as well as allows us to use new lines in the placeholder

* Update ErrorSection styles

* Update FilterModal

* Fixes spacing of interactive elements in FilterBar so they don't stretch according to content anymore
* Adds new `persistFilters` prop that determines whether the FilterBar should persist any filters to the user's cookies
* Uses defaultFilterset prop to populate the default filter set instead of importing the actual "default filter set" and using it directly

* Update FilterModal

* Adds a notice alerting users that filters on profiles and the saved page do not persist
* Exposes `persistFilters` prop that will be passed to FilterBar and used to determine if the notice should be displayed
* Autofocuses the first select on the page

* Fix visual bugs in GridRep

* Fixes the mainhand height not always being full height when the container was being responsively resized
* Adjusts the color of empty grid rectangles for dark and light mode and when being hovered over

* Remove unused code

* Update EditPartyModal

* Directly adds shadow code from DialogHeader since this dialog behaves slightly differently. In the future, we'd like to reconcile this so that the code only appears once
* Changes rendering functions to be properties
* Add DialogHeader and DialogFooter
* Implement Textarea component instead of raw textarea
* Removed unused code

* Update Party component

* Moves tab state management to the parent to prevent flickering and re-rendering
* Fixes local ID saving so that unauth users can make parties again
* Fixes the saving and display of numeric values (button count, chain count, turn count)

* Add functionality to PartyFooter buttons

The "Edit info" and "Remix" buttons now have their proper functionality in PartyFooter, matching how they behave in PartyHeader

* Update PartyHeader

* Fixes the display of numeric properties (button count, turn count, chain count)
* Refactors remixed pill/button so that it displays a message if the original party was deleted

* Add missing localization

* Fix raid keyboard navigation

* We added a plain "raid" style that our keyboard navigation code can hook onto, so that you can navigate the RaidCombobox raid list with the up and down arrow keys
* Fixed the raid item background color when hovering or focused
* Removed unused code

* Add class to fieldset instead of input

* Don't show quick summon icon on subaura summons

* Update styles for extra weapon units

* Implement filter changes

User profiles and saved teams won't use a user's filter cookies or persist filters anymore

* Add missing localization for "Loading..."

* Add tab management to pages

Tab management was previously handled by `Party` but things are smoother and less flicker-y if we handle them on the pages themselves

* Update localizations

* Extract createLocalId into a util

We extracted createLocalId into a method outside of the new page. Now, it can be used as a fallback when fetching the local ID if that local ID doesn't exist yet

* Add permissive filter set

This is the default filter set on user profiles and the saved teams page

* Add a bunch of new colors and theme variables

* Notice variables for FilterModal
* Unit background variables for GridRep
* An array of accent yellow colors
* Modified disabled button values in dark theme
* Modified extra purple text color in dark theme

* Change NotFound to be a class instead of ID

* Move slideRight animation into Toast component

* Remove keyframes.scss

Unfortunately, CSS modules makes it unreasonably difficult to have a central repository of CSS animations and reuse them, so we have copied these into the stylesheets of components that use them.

* Remove keyframes.scss from globals

* Update styles for conflict modals

* The actual styles for these were in DialogContent and had been deleted, so we fetched them from a previous commit
* Conflict modals get added to the exception that gives them a taller max height
* We can probably combine the meat of these into a ConflictDiagram component

* Add keys to conflict buttons

* Fix conflict CSS

Was accidentally adding it to a declaration that was setting min-height instead of max-height

* Fix character conflict modal only appearing once

We weren't changing the modal open state to false

* Alert overlays should display over modals

We were using the same Overlay with no changes, so alerts would display over modals without an overlay behind them

* Add missing localization for earring errors

* Normalize over mastery object

The over mastery object was sometimes 0-index, sometimes 1-index. This normalizes it to be 1-indexed, even though that is a little silly. I think this is the lesser amount of work though, since normalizing against 0-index might require API changes

* Fix ExtendedMasterySelect styles

* Fix RingSelect styles and functionality

* Updates styles for CSS modules
* Updates for normalized 1-index object
* Properly falls back to 0 value if value is not set

* Normalize 1-index for over mastery

* Fix AwakeningSelectWithInput styles and functionality

* Adapts styles for CSS modules
* Properly sends validity
* Reordered errors

* Fix SelectWithInput styles and functionality

* Adapts styles for CSS modules
* Add name to errors
* Properly sends validity

* Add extra modifier styles to Input/Select

* Update CharacterModal

* Adapts styles for CSS modules
* Adds an alert if the user tries to close a dialog with changes without saving
* Uses constants instead of functions for rendering helpers
* Fixes validation

* Reset values when the dialog is closed

The way we handle state means that we will keep old, unsaved values around if we don't do this

* Move GridWeaponObject to types

* Add unsaved changes localizations

* Localize unsaved changes alert

* Increase spacing of range mod style

* Update ElementToggle to use CSS modules

* Refactor WeaponKeySelect

No longer makes an API call for each instantiation—instead we use the weapon keys downloaded on the server

* Update AxSelect for CSS modules

* Update weapon should happen in WeaponUnit

Previously, this happened in WeaponModal. It happens in CharacterUnit on that end, so this change brings us in line with how we're doing things elsewhere

* Update WeaponModal to incorporate latest changes

* Adds unsaved changes alert
* Updates to use refactored WeaponKeySelect
* Moves api code to parent via a updateWeapon prop
* Updates to use DialogHeader and DialogFooter
* Makes rendering functions into constants

* Set grid weapon element when downloaded

* Make things that should be bound, bound

* Update elemental colors

This makes elemental accent colors themed more consistently

* Add confirmation alert to Edit Party modal

* Fix how description is tested for changes

* Fix footer shadow in EditPartyModal

* Fix footer shadows for all other modals

Also removes default box-shadow and border-top

* Fix awakening modification check

Awakening wasn't being set when the modal loaded, so it was testing the gridWeapon value against undefined

* Use new element variables

* h5 in globals
* Buttons

* Don't show icon for balanced character awakening

Also, remove old CSS

* Small cleanup of parseInt

* Fix weapon element logic

We had broken null weapons changing sprites when the element was changed, and the change detection was also broken. Some more stringent logic checks fixed both.

* Fix more raid color stuff

This should be it for real this time

* Show AX section in WeaponHovercard

Was testing truthy/falsy which meant id 0 made it not display

* Fix padding so focus ring isn't cut off

* Refactor Header and add logout confirmation

* Fix page navigation when filtering collections

There was a bug that kept page navigation from working properly when filtering. Things would load multiple times, or load the wrong thing, or not navigate properly. That should all be fixed now.

* Fix styles for when a collection has no teams

* Fix Nextjs build errors
2023-07-04 00:43:49 -07:00

151 lines
4.3 KiB
TypeScript

import React from 'react'
import { Trans, useTranslation } from 'next-i18next'
import classNames from 'classnames'
import LinkItem from '../LinkItem'
import DiscordIcon from '~public/icons/discord.svg'
import GithubIcon from '~public/icons/github.svg'
import styles from './index.module.scss'
interface Props {}
const AboutPage: React.FC<Props> = (props: Props) => {
const { t: common } = useTranslation('common')
const { t: about } = useTranslation('about')
const classes = classNames(styles.about, 'PageContent')
return (
<div className={classes}>
<h1>{common('about.segmented_control.about')}</h1>
<section>
<h2>
<Trans i18nKey="about:about.subtitle">
Granblue.team is a tool to save and share team compositions for{' '}
<a
href="https://game.granbluefantasy.jp"
target="_blank"
rel="noreferrer"
>
Granblue Fantasy
</a>
, a social RPG from Cygames.
</Trans>
</h2>
<p>{about('about.explanation.0')}</p>
<p>{about('about.explanation.1')}</p>
<div className={styles.hero} />
</section>
<section>
<h2>{about('about.feedback.title')}</h2>
<p>{about('about.feedback.explanation')}</p>
<p>{about('about.feedback.solicit')}</p>
<LinkItem
className="discord constrained"
title="granblue-tools"
link="https://discord.gg/qyZ5hGdPC8"
icon={<DiscordIcon />}
/>
</section>
<section>
<h2>{about('about.credits.title')}</h2>
<p>
<Trans i18nKey="about:about.credits.maintainer">
Granblue.team was built and is maintained by{' '}
<a
href="https://twitter.com/jedmund"
target="_blank"
rel="noreferrer"
>
@jedmund
</a>
.
</Trans>
</p>
<p>
<Trans i18nKey="about:about.credits.assistance">
Many thanks to{' '}
<a
href="https://twitter.com/lalalalinna"
target="_blank"
rel="noreferrer"
>
@lalalalinna
</a>{' '}
and{' '}
<a
href="https://twitter.com/tarngerine"
target="_blank"
rel="noreferrer"
>
@tarngerine
</a>
, who both provided a lot of help and advice as I was ramping up.
</Trans>
</p>
<p>
<Trans i18nKey="about:about.credits.support">
Many thanks also go to everyone in{' '}
<a
href="https://game.granbluefantasy.jp/#guild/detail/1190185"
target="_blank"
rel="noreferrer"
>
Fireplace
</a>{' '}
and the granblue-tools Discord for all of their help with with bug
testing, feature requests, and moral support. (P.S. We&apos;re
recruiting!)
</Trans>
</p>
</section>
<section>
<h2>{about('about.contributing.title')}</h2>
<p>{about('about.contributing.explanation')}</p>
<div className={styles.links}>
<LinkItem
className="github constrained"
title="jedmund/hensei-api"
link="https://github.com/jedmund/hensei-api"
icon={<GithubIcon />}
/>
<LinkItem
className="github constrained"
title="jedmund/hensei-web"
link="https://github.com/jedmund/hensei-web"
icon={<GithubIcon />}
/>
</div>
</section>
<section>
<h2>{about('about.license.title')}</h2>
<p>
<Trans i18nKey="about:about.license.license">
This app is licensed under{' '}
<a
href="https://choosealicense.com/licenses/agpl-3.0/"
target="_blank"
rel="noreferrer"
>
GNU AGPLv3
</a>
.
</Trans>
</p>
<p>{about('about.license.explanation')}</p>
</section>
<section>
<h2>{about('about.copyright.title')}</h2>
<p>{about('about.copyright.explanation')}</p>
</section>
</div>
)
}
export default AboutPage