Merge pull request #99 from jedmund/fix-job-weapon-select
Fixes various issues with jobs and weapons
This commit is contained in:
commit
8f1594af68
5 changed files with 19 additions and 4 deletions
|
|
@ -4,6 +4,10 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
max-width: 761px;
|
max-width: 761px;
|
||||||
|
|
||||||
|
@include breakpoint(tablet) {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#grid_characters {
|
#grid_characters {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
height: auto;
|
height: auto;
|
||||||
min-width: $unit * 48;
|
min-width: $unit * 48;
|
||||||
min-height: $unit-12x;
|
min-height: $unit-12x;
|
||||||
|
min-width: 580px;
|
||||||
padding: $unit * $multiplier;
|
padding: $unit * $multiplier;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,9 @@ const JobDropdown = React.forwardRef<HTMLSelectElement, Props>(
|
||||||
|
|
||||||
// Set current job from state on mount
|
// Set current job from state on mount
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentJob(party.job)
|
if (party.job.id !== '-1') {
|
||||||
|
setCurrentJob(party.job)
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
// Organize jobs into groups on mount
|
// Organize jobs into groups on mount
|
||||||
|
|
@ -107,7 +109,6 @@ const JobDropdown = React.forwardRef<HTMLSelectElement, Props>(
|
||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
value={currentJob ? currentJob.id : 'no-job'}
|
value={currentJob ? currentJob.id : 'no-job'}
|
||||||
placeholder={'Select a class...'}
|
|
||||||
open={open}
|
open={open}
|
||||||
onClick={openJobSelect}
|
onClick={openJobSelect}
|
||||||
onOpenChange={() => setOpen(!open)}
|
onOpenChange={() => setOpen(!open)}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
#Job {
|
#Job {
|
||||||
align-items: center;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: $unit * 3;
|
margin-bottom: $unit * 3;
|
||||||
|
|
||||||
@include breakpoint(tablet) {
|
@include breakpoint(tablet) {
|
||||||
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: $unit;
|
gap: $unit;
|
||||||
|
justify-content: center;
|
||||||
|
max-width: 447px;
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
@ -58,6 +60,10 @@
|
||||||
width: $width;
|
width: $width;
|
||||||
transition: box-shadow 0.15s ease-in-out;
|
transition: box-shadow 0.15s ease-in-out;
|
||||||
|
|
||||||
|
@include breakpoint(tablet) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
@include breakpoint(phone) {
|
@include breakpoint(phone) {
|
||||||
aspect-ratio: 16/9;
|
aspect-ratio: 16/9;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
||||||
|
|
@ -390,7 +390,10 @@ const WeaponUnit = (props: Props) => {
|
||||||
|
|
||||||
const unitContent = (
|
const unitContent = (
|
||||||
<div className={classes}>
|
<div className={classes}>
|
||||||
{props.editable && gridWeapon && canBeModified(gridWeapon) ? (
|
{props.editable &&
|
||||||
|
gridWeapon &&
|
||||||
|
gridWeapon.id &&
|
||||||
|
canBeModified(gridWeapon) ? (
|
||||||
<WeaponModal gridWeapon={gridWeapon}>
|
<WeaponModal gridWeapon={gridWeapon}>
|
||||||
<div>
|
<div>
|
||||||
<Button accessoryIcon={<SettingsIcon />} />
|
<Button accessoryIcon={<SettingsIcon />} />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue