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
This commit is contained in:
parent
ecff0b569f
commit
fba1a6dfde
5 changed files with 168 additions and 27 deletions
|
|
@ -0,0 +1,69 @@
|
||||||
|
.content {
|
||||||
|
$weapon-diameter: 14rem;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: $unit-4x;
|
||||||
|
padding: $unit-4x $unit-4x $unit-2x $unit-4x;
|
||||||
|
|
||||||
|
& > p {
|
||||||
|
font-size: $font-regular;
|
||||||
|
line-height: 1.4;
|
||||||
|
|
||||||
|
strong {
|
||||||
|
font-weight: $bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:lang(ja) {
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagram {
|
||||||
|
align-items: center;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto 1fr;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: $unit-2x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.character {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: $unit;
|
||||||
|
text-align: center;
|
||||||
|
width: $weapon-diameter;
|
||||||
|
font-weight: $medium;
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-radius: 1rem;
|
||||||
|
width: $weapon-diameter;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow {
|
||||||
|
align-items: center;
|
||||||
|
color: $grey-55;
|
||||||
|
display: flex;
|
||||||
|
font-size: 4rem;
|
||||||
|
text-align: center;
|
||||||
|
height: $weapon-diameter;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import { Trans, useTranslation } from 'next-i18next'
|
||||||
|
|
||||||
import { Dialog } from '~components/common/Dialog'
|
import { Dialog } from '~components/common/Dialog'
|
||||||
import DialogContent from '~components/common/DialogContent'
|
import DialogContent from '~components/common/DialogContent'
|
||||||
|
import DialogFooter from '~components/common/DialogFooter'
|
||||||
import Button from '~components/common/Button'
|
import Button from '~components/common/Button'
|
||||||
import Overlay from '~components/common/Overlay'
|
import Overlay from '~components/common/Overlay'
|
||||||
|
|
||||||
|
|
@ -75,19 +76,19 @@ const CharacterConflictModal = (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={openChange}>
|
<Dialog open={open} onOpenChange={openChange}>
|
||||||
<DialogContent
|
<DialogContent
|
||||||
className="Conflict"
|
className="conflict"
|
||||||
footerref={footerRef}
|
footerref={footerRef}
|
||||||
onOpenAutoFocus={(event) => event.preventDefault()}
|
onOpenAutoFocus={(event) => event.preventDefault()}
|
||||||
onEscapeKeyDown={close}
|
onEscapeKeyDown={close}
|
||||||
>
|
>
|
||||||
<div className="Content">
|
<div className={styles.content}>
|
||||||
<p>
|
<p>
|
||||||
<Trans i18nKey="modals.conflict.character"></Trans>
|
<Trans i18nKey="modals.conflict.character"></Trans>
|
||||||
</p>
|
</p>
|
||||||
<div className="CharacterDiagram Diagram">
|
<div className={styles.diagram}>
|
||||||
<ul>
|
<ul>
|
||||||
{props.conflictingCharacters?.map((character, i) => (
|
{props.conflictingCharacters?.map((character, i) => (
|
||||||
<li className="character" key={`conflict-${i}`}>
|
<li className={styles.character} key={`conflict-${i}`}>
|
||||||
<img
|
<img
|
||||||
alt={character.object.name[locale]}
|
alt={character.object.name[locale]}
|
||||||
src={imageUrl(character.object, character.uncap_level)}
|
src={imageUrl(character.object, character.uncap_level)}
|
||||||
|
|
@ -96,9 +97,9 @@ const CharacterConflictModal = (props: Props) => {
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
<span className="arrow">→</span>
|
<span className={styles.arrow}>→</span>
|
||||||
<div className="wrapper">
|
<div className={styles.wrapper}>
|
||||||
<div className="character">
|
<div className={styles.character}>
|
||||||
<img
|
<img
|
||||||
alt={props.incomingCharacter?.name[locale]}
|
alt={props.incomingCharacter?.name[locale]}
|
||||||
src={imageUrl(props.incomingCharacter)}
|
src={imageUrl(props.incomingCharacter)}
|
||||||
|
|
@ -108,16 +109,16 @@ const CharacterConflictModal = (props: Props) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="DialogFooter" ref={footerRef}>
|
<DialogFooter
|
||||||
<div className="Buttons Span">
|
rightElements={[
|
||||||
<Button bound={true} onClick={close} text={t('buttons.cancel')} />
|
<Button bound={true} onClick={close} text={t('buttons.cancel')} />,
|
||||||
<Button
|
<Button
|
||||||
bound={true}
|
bound={true}
|
||||||
onClick={props.resolveConflict}
|
onClick={props.resolveConflict}
|
||||||
text={t('modals.conflict.buttons.confirm')}
|
text={t('modals.conflict.buttons.confirm')}
|
||||||
/>
|
/>,
|
||||||
</div>
|
]}
|
||||||
</div>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<Overlay open={open} visible={true} />
|
<Overlay open={open} visible={true} />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.editParty {
|
&.editParty,
|
||||||
|
&.conflict {
|
||||||
min-height: 80vh;
|
min-height: 80vh;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
.content {
|
||||||
|
$weapon-diameter: 14rem;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: $unit-4x;
|
||||||
|
padding: $unit-4x $unit-4x $unit-2x $unit-4x;
|
||||||
|
|
||||||
|
& > p {
|
||||||
|
font-size: $font-regular;
|
||||||
|
line-height: 1.4;
|
||||||
|
|
||||||
|
strong {
|
||||||
|
font-weight: $bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:lang(ja) {
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagram {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto 1fr;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: $unit-2x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.weapon {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: $unit;
|
||||||
|
text-align: center;
|
||||||
|
width: $weapon-diameter;
|
||||||
|
font-weight: $medium;
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-radius: 1rem;
|
||||||
|
width: $weapon-diameter;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow {
|
||||||
|
align-items: center;
|
||||||
|
color: $grey-55;
|
||||||
|
display: flex;
|
||||||
|
font-size: 4rem;
|
||||||
|
text-align: center;
|
||||||
|
height: $weapon-diameter;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
import { Dialog } from '~components/common/Dialog'
|
import { Dialog } from '~components/common/Dialog'
|
||||||
import DialogContent from '~components/common/DialogContent'
|
import DialogContent from '~components/common/DialogContent'
|
||||||
|
import DialogFooter from '~components/common/DialogFooter'
|
||||||
import Button from '~components/common/Button'
|
import Button from '~components/common/Button'
|
||||||
import Overlay from '~components/common/Overlay'
|
import Overlay from '~components/common/Overlay'
|
||||||
|
|
||||||
|
|
@ -69,17 +70,17 @@ const WeaponConflictModal = (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={openChange}>
|
<Dialog open={open} onOpenChange={openChange}>
|
||||||
<DialogContent
|
<DialogContent
|
||||||
className="Conflict"
|
className="conflict"
|
||||||
footerref={footerRef}
|
footerref={footerRef}
|
||||||
onOpenAutoFocus={(event) => event.preventDefault()}
|
onOpenAutoFocus={(event) => event.preventDefault()}
|
||||||
onEscapeKeyDown={close}
|
onEscapeKeyDown={close}
|
||||||
>
|
>
|
||||||
<div className="Content">
|
<div className={styles.content}>
|
||||||
<p>{infoString()}</p>
|
<p>{infoString()}</p>
|
||||||
<div className="WeaponDiagram Diagram">
|
<div className={styles.diagram}>
|
||||||
<ul>
|
<ul>
|
||||||
{props.conflictingWeapons?.map((weapon, i) => (
|
{props.conflictingWeapons?.map((weapon, i) => (
|
||||||
<li className="weapon" key={`conflict-${i}`}>
|
<li className={styles.weapon} key={`conflict-${i}`}>
|
||||||
<img
|
<img
|
||||||
alt={weapon.object.name[locale]}
|
alt={weapon.object.name[locale]}
|
||||||
src={imageUrl(weapon.object)}
|
src={imageUrl(weapon.object)}
|
||||||
|
|
@ -88,9 +89,9 @@ const WeaponConflictModal = (props: Props) => {
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
<span className="arrow">→</span>
|
<span className={styles.arrow}>→</span>
|
||||||
<div className="wrapper">
|
<div className={styles.wrapper}>
|
||||||
<div className="weapon">
|
<div className={styles.weapon}>
|
||||||
<img
|
<img
|
||||||
alt={props.incomingWeapon?.name[locale]}
|
alt={props.incomingWeapon?.name[locale]}
|
||||||
src={imageUrl(props.incomingWeapon)}
|
src={imageUrl(props.incomingWeapon)}
|
||||||
|
|
@ -100,16 +101,16 @@ const WeaponConflictModal = (props: Props) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="DialogFooter" ref={footerRef}>
|
<DialogFooter
|
||||||
<div className="Buttons Span">
|
rightElements={[
|
||||||
<Button bound={true} onClick={close} text={t('buttons.cancel')} />
|
<Button bound={true} onClick={close} text={t('buttons.cancel')} />,
|
||||||
<Button
|
<Button
|
||||||
bound={true}
|
bound={true}
|
||||||
onClick={props.resolveConflict}
|
onClick={props.resolveConflict}
|
||||||
text={t('modals.conflict.buttons.confirm')}
|
text={t('modals.conflict.buttons.confirm')}
|
||||||
/>
|
/>,
|
||||||
</div>
|
]}
|
||||||
</div>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<Overlay open={open} visible={true} />
|
<Overlay open={open} visible={true} />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue