feat: categories and popups #171
@ -1100,44 +1100,33 @@ export const CategoryAutocomplete = ({
|
|||||||
{Row}
|
{Row}
|
||||||
</VariableSizeList>
|
</VariableSizeList>
|
||||||
) : (
|
) : (
|
||||||
<FixedSizeList
|
<div
|
||||||
height={500}
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
width={'100%'}
|
onClick={handleAddNew}
|
||||||
itemCount={1}
|
|
||||||
itemSize={35}
|
|
||||||
>
|
>
|
||||||
{({ index, style }) => (
|
{inputValue &&
|
||||||
<div
|
!filteredOptions?.find(
|
||||||
style={style}
|
(option) =>
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
option.hierarchy.toLowerCase() === inputValue.toLowerCase()
|
||||||
onClick={handleAddNew}
|
) ? (
|
||||||
>
|
<>
|
||||||
{inputValue &&
|
Add "{inputValue}"
|
||||||
!filteredOptions?.find(
|
<button className='btn btnMain btnMainInsideField btnMainRemove'>
|
||||||
(option) =>
|
<svg
|
||||||
option.hierarchy.toLowerCase() ===
|
xmlns='http://www.w3.org/2000/svg'
|
||||||
inputValue.toLowerCase()
|
viewBox='-32 0 512 512'
|
||||||
) ? (
|
width='1em'
|
||||||
<>
|
height='1em'
|
||||||
Add "{inputValue}"
|
fill='currentColor'
|
||||||
<button className='btn btnMain btnMainInsideField btnMainRemove'>
|
>
|
||||||
<svg
|
<path d='M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z'></path>
|
||||||
xmlns='http://www.w3.org/2000/svg'
|
</svg>
|
||||||
viewBox='-32 0 512 512'
|
</button>
|
||||||
width='1em'
|
</>
|
||||||
height='1em'
|
) : (
|
||||||
fill='currentColor'
|
<>No matches</>
|
||||||
>
|
|
||||||
<path d='M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z'></path>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>No matches</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</FixedSizeList>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1147,18 +1136,25 @@ export const CategoryAutocomplete = ({
|
|||||||
{LTags.map((hierarchy) => {
|
{LTags.map((hierarchy) => {
|
||||||
const heirarchicalCategories = hierarchy.split(`:`)
|
const heirarchicalCategories = hierarchy.split(`:`)
|
||||||
const categories = heirarchicalCategories
|
const categories = heirarchicalCategories
|
||||||
.map<React.ReactNode>((c, i) => (
|
.map<React.ReactNode>((c, i) =>
|
||||||
<Link
|
game ? (
|
||||||
key={`category-${i}`}
|
<Link
|
||||||
to={{
|
key={`category-${i}`}
|
||||||
pathname: getGamePageRoute(game),
|
target='_blank'
|
||||||
search: `l=${c}`
|
to={{
|
||||||
}}
|
pathname: getGamePageRoute(game),
|
||||||
className='IBMSMSMBSSCategoriesBoxItem'
|
search: `l=${c}`
|
||||||
>
|
}}
|
||||||
<p>{capitalizeEachWord(c)}</p>
|
className='IBMSMSMBSSCategoriesBoxItem'
|
||||||
</Link>
|
>
|
||||||
))
|
<p>{capitalizeEachWord(c)}</p>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<p className='IBMSMSMBSSCategoriesBoxItem'>
|
||||||
|
{capitalizeEachWord(c)}
|
||||||
|
</p>
|
||||||
|
)
|
||||||
|
)
|
||||||
.reduce((prev, curr, i) => [
|
.reduce((prev, curr, i) => [
|
||||||
prev,
|
prev,
|
||||||
<div
|
<div
|
||||||
|
@ -548,6 +548,7 @@ const Body = ({
|
|||||||
.map<React.ReactNode>((c: string) => (
|
.map<React.ReactNode>((c: string) => (
|
||||||
<ReactRouterLink
|
<ReactRouterLink
|
||||||
className='IBMSMSMBSSCategoriesBoxItem'
|
className='IBMSMSMBSSCategoriesBoxItem'
|
||||||
|
target='_blank'
|
||||||
to={{
|
to={{
|
||||||
pathname: getGamePageRoute(game),
|
pathname: getGamePageRoute(game),
|
||||||
search: `l=${c}`
|
search: `l=${c}`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user