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