fix: Lint Errors (returning possible null component)

This commit is contained in:
blessedcoolant 2023-07-28 19:03:29 +12:00
parent f155b03eee
commit 14c4650801
2 changed files with 120 additions and 119 deletions

View File

@ -13,6 +13,10 @@ export default function ParamSDXLPromptArea() {
(state: RootState) => state.ui.shouldPinParametersPanel (state: RootState) => state.ui.shouldPinParametersPanel
); );
const shouldConcatSDXLStylePrompt = useAppSelector(
(state: RootState) => state.sdxl.shouldConcatSDXLStylePrompt
);
return ( return (
<Flex <Flex
sx={{ sx={{
@ -20,6 +24,7 @@ export default function ParamSDXLPromptArea() {
gap: 2, gap: 2,
}} }}
> >
{shouldConcatSDXLStylePrompt && (
<Box <Box
sx={{ sx={{
position: 'absolute', position: 'absolute',
@ -29,6 +34,8 @@ export default function ParamSDXLPromptArea() {
> >
<SDXLConcatLink /> <SDXLConcatLink />
</Box> </Box>
)}
{shouldConcatSDXLStylePrompt && (
<Box <Box
sx={{ sx={{
position: 'absolute', position: 'absolute',
@ -38,6 +45,7 @@ export default function ParamSDXLPromptArea() {
> >
<SDXLConcatLink /> <SDXLConcatLink />
</Box> </Box>
)}
<ParamPositiveConditioning /> <ParamPositiveConditioning />
<ParamSDXLConcatButton /> <ParamSDXLConcatButton />
<ParamSDXLPositiveStyleConditioning /> <ParamSDXLPositiveStyleConditioning />

View File

@ -1,15 +1,9 @@
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import { RootState } from 'app/store/store';
import { useAppSelector } from 'app/store/storeHooks';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { FaLink } from 'react-icons/fa'; import { FaLink } from 'react-icons/fa';
export default function SDXLConcatLink() { export default function SDXLConcatLink() {
const shouldConcatSDXLStylePrompt = useAppSelector(
(state: RootState) => state.sdxl.shouldConcatSDXLStylePrompt
);
return ( return (
shouldConcatSDXLStylePrompt && (
<Flex <Flex
sx={{ sx={{
h: 0.5, h: 0.5,
@ -107,6 +101,5 @@ export default function SDXLConcatLink() {
}} }}
/> />
</Flex> </Flex>
)
); );
} }