|
|
|
@ -8,26 +8,14 @@ import { IconSearch } from '@tabler/icons';
|
|
|
|
|
|
|
|
|
|
// berry ui
|
|
|
|
|
import MainCard from 'ui-component/cards/MainCard';
|
|
|
|
|
import { useDispatch, useSelector } from 'store';
|
|
|
|
|
|
|
|
|
|
// project imports
|
|
|
|
|
import MuiGridList from 'ui-component/MuiGridList';
|
|
|
|
|
import boardService from 'apis/BoardService';
|
|
|
|
|
|
|
|
|
|
const Index = () => {
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
const [category, setCategory] = useState('ciTitle');
|
|
|
|
|
const [searchTxt, setSearchTxt] = useState('');
|
|
|
|
|
// const handleSearch = async (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | undefined) => {
|
|
|
|
|
// const newString = event?.target.value;
|
|
|
|
|
// setSearch(newString);
|
|
|
|
|
//
|
|
|
|
|
// if (newString) {
|
|
|
|
|
// dispatch(filterDetailCards(newString));
|
|
|
|
|
// } else {
|
|
|
|
|
// dispatch(getDetailCards());
|
|
|
|
|
// }
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
const [totalCount, setTotalCount] = useState(0);
|
|
|
|
|
const [rowsState, setRowsState] = useState({
|
|
|
|
@ -70,22 +58,13 @@ const Index = () => {
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
const handleSearch = async (event) => {
|
|
|
|
|
console.log('~~~');
|
|
|
|
|
if (event.type === 'keydown' && event.key === 'Enter') {
|
|
|
|
|
const newString = event?.target.value;
|
|
|
|
|
setSearchTxt(newString);
|
|
|
|
|
|
|
|
|
|
// if (newString) {
|
|
|
|
|
// dispatch(filterDetailCards(newString));
|
|
|
|
|
// } else {
|
|
|
|
|
// dispatch(getDetailCards());
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// setRowsState(prev => ({...prev}))
|
|
|
|
|
|
|
|
|
|
let params = {
|
|
|
|
|
page: rowsState.page + 1,
|
|
|
|
|
size: rowsState.pageSize
|
|
|
|
@ -98,166 +77,19 @@ const Index = () => {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const res = boardService.getBoardList(params).then((response) => {
|
|
|
|
|
boardService.getBoardList(params).then((response) => {
|
|
|
|
|
console.log(response);
|
|
|
|
|
if (response && response.data) {
|
|
|
|
|
// setTotalCount(response?.count);
|
|
|
|
|
setTotalCount(response.count);
|
|
|
|
|
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// if (res) {
|
|
|
|
|
// setTotalCount(res.count);
|
|
|
|
|
// setRowsState((prev) => ({ ...prev, rows: res.data }));
|
|
|
|
|
// }
|
|
|
|
|
// fetch(
|
|
|
|
|
// // `https://jsonplaceholder.typicode.com/comments?_start=${params.startRow}&_end=${params.endRow}`
|
|
|
|
|
// `http://localhost:8090/api/v1/ctgy/board?page=${rowsState.page + 1}&size=${rowsState.pageSize}${search}`
|
|
|
|
|
// )
|
|
|
|
|
// .then((r) => r.json())
|
|
|
|
|
// .then((data) => {
|
|
|
|
|
// setTotalCount(data.count);
|
|
|
|
|
// // setTableData(data.data);
|
|
|
|
|
// setRowsState((prev) => ({ ...prev, rows: data.data }));
|
|
|
|
|
// });
|
|
|
|
|
}, [rowsState.page, rowsState.pageSize, searchTxt]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<MainCard
|
|
|
|
|
// title={
|
|
|
|
|
// <Grid container alignItems="center" justifyContent="space-between" spacing={gridSpacing}>
|
|
|
|
|
// <Grid item>
|
|
|
|
|
// <Typography variant="h3">List</Typography>
|
|
|
|
|
// </Grid>
|
|
|
|
|
// <Grid item>
|
|
|
|
|
// <OutlinedInput
|
|
|
|
|
// id="input-search-list-style1"
|
|
|
|
|
// placeholder="Search"
|
|
|
|
|
// // onChange={handleSearch}
|
|
|
|
|
// onKeyDown={handleSearch}
|
|
|
|
|
// startAdornment={
|
|
|
|
|
// <InputAdornment position="start">
|
|
|
|
|
// <IconSearch stroke={1.5} size="1rem" />
|
|
|
|
|
// </InputAdornment>
|
|
|
|
|
// }
|
|
|
|
|
// size="small"
|
|
|
|
|
// />
|
|
|
|
|
// </Grid>
|
|
|
|
|
// </Grid>
|
|
|
|
|
// }
|
|
|
|
|
>
|
|
|
|
|
<MainCard>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
{/*
|
|
|
|
|
<Grid item xs={12} lg={4}>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
|
|
|
|
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
|
|
|
|
Name :
|
|
|
|
|
</InputLabel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={9} lg={8}>
|
|
|
|
|
<TextField fullWidth placeholder="Enter full name" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} lg={4}>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
|
|
|
|
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
|
|
|
|
Email :
|
|
|
|
|
</InputLabel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={9} lg={8}>
|
|
|
|
|
<TextField fullWidth placeholder="Enter email" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} lg={4}>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
|
|
|
|
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
|
|
|
|
Password :
|
|
|
|
|
</InputLabel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={9} lg={8}>
|
|
|
|
|
<TextField
|
|
|
|
|
type="password"
|
|
|
|
|
fullWidth
|
|
|
|
|
placeholder="Enter Password"
|
|
|
|
|
InputProps={{
|
|
|
|
|
startAdornment: (
|
|
|
|
|
<InputAdornment position="start">
|
|
|
|
|
<LockTwoToneIcon />
|
|
|
|
|
</InputAdornment>
|
|
|
|
|
)
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} lg={4}>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
|
|
|
|
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
|
|
|
|
Contact :
|
|
|
|
|
</InputLabel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={9} lg={8}>
|
|
|
|
|
<TextField fullWidth placeholder="Enter contact number" />
|
|
|
|
|
<FormHelperText>Please enter your contact</FormHelperText>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} lg={4}>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
|
|
|
|
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
|
|
|
|
Profile URL :
|
|
|
|
|
</InputLabel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={9} lg={8}>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
placeholder="Please enter your Profile URL"
|
|
|
|
|
InputProps={{
|
|
|
|
|
endAdornment: (
|
|
|
|
|
<InputAdornment position="end">
|
|
|
|
|
<LinkTwoToneIcon />
|
|
|
|
|
</InputAdornment>
|
|
|
|
|
)
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} lg={4}>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
|
|
|
|
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
|
|
|
|
Pincode :
|
|
|
|
|
</InputLabel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={9} lg={8}>
|
|
|
|
|
<TextField fullWidth placeholder="Enter your postcode" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} lg={4}>
|
|
|
|
|
<Grid container spacing={2} alignItems="center">
|
|
|
|
|
<Grid item xs={12} sm={3} lg={4} sx={{ pt: { xs: 2, sm: '0 !important' } }}>
|
|
|
|
|
<InputLabel horizontal sx={{ textAlign: { xs: 'left', sm: 'right' } }}>
|
|
|
|
|
Address :
|
|
|
|
|
</InputLabel>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12} sm={9} lg={8}>
|
|
|
|
|
<TextField fullWidth placeholder="Enter your address" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
*/}
|
|
|
|
|
|
|
|
|
|
{/* <Grid item xs={12} lg={4}> */}
|
|
|
|
|
{/* <Grid container spacing={2} alignItems="center"> */}
|
|
|
|
|
<Grid item xs={6} lg={3}>
|
|
|
|
|
<Grid item xs={12} lg={6}>
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<FormControl>
|
|
|
|
@ -281,14 +113,12 @@ const Index = () => {
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
{/* </Grid> */}
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Divider />
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Divider />
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<MuiGridList columns={columns} rowsState={rowsState} totalCount={totalCount} setRowsState={setRowsState} />
|
|
|
|
|
</MainCard>
|
|
|
|
|
);
|
|
|
|
|