diff --git a/src/components/admin/adminHome/AdminHome.tsx b/src/components/admin/adminHome/AdminHome.tsx index e92b1666f61a56c649378a08b4d1a8c584931677..b39cb08050eebe07850577b37fde858bc1032cf7 100644 --- a/src/components/admin/adminHome/AdminHome.tsx +++ b/src/components/admin/adminHome/AdminHome.tsx @@ -107,11 +107,15 @@ const AdminHome: React.FC = () => { <Route path={`${path}/fragen`}> <QuestionView /> </Route> - <Route path={`${path}/synchronisieren`}></Route> + <Route path={`${path}/synchronisieren`}> + <SynchroniseView /> + </Route> <Route path={`${path}/snacks`}> <SnacksView /> </Route> - <Route path={`${path}/reinfolge`}></Route> + <Route path={`${path}/reinfolge`}> + <OrderView /> + </Route> <Route path={`${path}/translation`}> <TranslationView /> </Route> diff --git a/src/components/admin/snacks & co/ImageManager.tsx b/src/components/admin/snacks & co/ImageManager.tsx index ea5af5e37868b011820aaf1ae7dbaa3bdceb7d5d..1761cc9cc8d01694a2182d9052df196e9820b16b 100644 --- a/src/components/admin/snacks & co/ImageManager.tsx +++ b/src/components/admin/snacks & co/ImageManager.tsx @@ -13,7 +13,7 @@ import { ImagesInformationResponse } from '../../../types/ApiTypes' import { createStyles, makeStyles, Theme } from '@material-ui/core' import { Checkbox } from '@material-ui/core' import { useCallback } from 'react' -import { adminFetch } from '../../utils/common' +import { adminFetch } from '../../../utils/common' const useStyles = makeStyles((theme: Theme) => createStyles({ diff --git a/src/components/admin/sports/SportartenTable.tsx b/src/components/admin/sports/SportartenTable.tsx index 1d8e8e8e281e8e32a9b7bcf32e4f52bbd7ae5887..4d184f3e49ae0a0fd6d67a96e6b8b735747beb2e 100644 --- a/src/components/admin/sports/SportartenTable.tsx +++ b/src/components/admin/sports/SportartenTable.tsx @@ -24,96 +24,6 @@ interface SportartenTableProps { updateRef: any } -interface CustomTableRowProps { - index: number - valueRef: React.MutableRefObject<ISports[]> - updateRef: any - sportarten: ISports[] - sportId: string -} - -const CustomTableRow: React.FC<CustomTableRowProps> = ({ - index, - valueRef, - updateRef, - sportarten, - sportId -}) => { - const sport = valueRef.current[index] - - const rowRef = useRef<HTMLTableRowElement>(null) - const [visible, setVisible] = useState(false) - - useEffect(() => { - if (!rowRef.current) return - const iObs = new IntersectionObserver( - (entries) => { - setVisible(entries[0].isIntersecting) - }, - { rootMargin: '200px' } - ) // load rows 200px before screen - - iObs.observe(rowRef.current) - - // disconnect on unmount - return () => { - console.log('disconnect') - iObs.disconnect() - } - }, [rowRef]) - - return ( - <TableRow ref={rowRef}> - <TableCell> {sport.name}</TableCell> - {Object.keys(sport.categoryWeights).map(function (key) { - return ( - <TableCell key={sport.name + '_' + key}> - {visible && ( - <CustomCell - index={index} - categorieId={key} - valueRef={valueRef} - data={sport.categoryWeights[key]} - sportarten={sportarten} - /> - )} - </TableCell> - ) - })} - <TableCell /> - <TableCell> - <a - href={'https://' + sport.url} - target="_blank" - rel="noreferrer" - > - {sport.url} - </a> - </TableCell> - <TableCell> - <IconButton - onClick={() => { - sport.active = !sport.active - updateRef() - }} - > - {sport.active ? <ArrowDownward /> : <ArrowUpward />} - </IconButton> - </TableCell> - <TableCell> - <IconButton - onClick={() => { - valueRef.current.splice(index, 1) - updateRef() - }} - > - <ClearIcon /> - </IconButton> - </TableCell> - </TableRow> - ) -} - export const SportartenTable: React.FC<SportartenTableProps> = ({ sportarten, categories,