* Small refactor to CharLimitedFieldset Some methods were renamed for clarity. <input> props are actually put on the input properly. * Add tabindex to Popover trigger * Add tabindex to Switch and SwitchTableField * Add tabindex to DurationInput * Add new properties * Added guidebooks to RaidGroup * Added auto_summon to Party * Conditionally render description in TableField * Improve SwitchTableField * Add support for passing in classes * Add support for passing a disabled prop * Pass description to TableField * Right-align switch * Add support for Extra color switch * Align SliderTableField input to right * Align SelectTableField input to right * Update placeholder styles * Fix empty state on DurationInput * Remove tabindex from DurationInput * Update InputTableField Allow for passing down input properties and remove fixed width * Fix dialog footer styles * Update dialog and overlay z-index * Add styles to TableField Added styles for numeric inputs, disabled inputs, and generally cleaning things up * Add guidebooks to RaidCombobox + styles * Added guidebooks to the dummy raid group * Fix background color * Make less tall * Implement EditPartyModal EditPartyModal takes functionality that was in PartyHeader and puts it in a modal dialog. This lets us add fields and reduces the complexity of other components. Translations were also added. * Remove edit functionality * Add darker shadow to Select * Properly send raid ID to server * Show Extra grids based on selected raid * Fix EX badge colors * Use child as value in normal textarea * Remove toggle ability from Extra grids * Remove edit functionality from PartyDetails
69 lines
1.5 KiB
TypeScript
69 lines
1.5 KiB
TypeScript
import React, { useEffect, useState } from 'react'
|
|
import { useTranslation } from 'next-i18next'
|
|
import Switch from '~components/common/Switch'
|
|
import GuidebookUnit from '../GuidebookUnit'
|
|
import classNames from 'classnames'
|
|
|
|
import type { SearchableObject } from '~types'
|
|
|
|
import './index.scss'
|
|
|
|
// Props
|
|
interface Props {
|
|
grid: GuidebookList
|
|
editable: boolean
|
|
removeGuidebook: (position: number) => void
|
|
updateObject: (object: SearchableObject, position: number) => void
|
|
}
|
|
|
|
// Constants
|
|
const EXTRA_WEAPONS_COUNT = 3
|
|
|
|
const GuidebooksGrid = ({
|
|
grid,
|
|
editable,
|
|
removeGuidebook,
|
|
updateObject,
|
|
}: Props) => {
|
|
const { t } = useTranslation('common')
|
|
|
|
const classes = classNames({
|
|
Guidebooks: true,
|
|
ContainerItem: true,
|
|
})
|
|
|
|
const guidebooks = (
|
|
<ul id="GuidebooksGrid">
|
|
{Array.from(Array(EXTRA_WEAPONS_COUNT)).map((x, i) => {
|
|
const itemClasses = classNames({
|
|
Empty: grid && grid[i] === undefined,
|
|
})
|
|
|
|
return (
|
|
<li className={itemClasses} key={`grid_unit_${i}`}>
|
|
<GuidebookUnit
|
|
editable={editable}
|
|
position={i + 1}
|
|
guidebook={grid[i + 1]}
|
|
removeGuidebook={removeGuidebook}
|
|
updateObject={updateObject}
|
|
/>
|
|
</li>
|
|
)
|
|
})}
|
|
</ul>
|
|
)
|
|
|
|
const guidebookElement = (
|
|
<div className={classes}>
|
|
<div className="Header">
|
|
<h3>{t('sephira_guidebooks')}</h3>
|
|
</div>
|
|
{guidebooks}
|
|
</div>
|
|
)
|
|
|
|
return guidebookElement
|
|
}
|
|
|
|
export default GuidebooksGrid
|