# fix
- authentication
- profile
- pencarian user
- forum
## No issue
This commit is contained in:
2024-05-20 10:55:13 +08:00
parent 66b9902d97
commit dbeb740d1f
58 changed files with 1374 additions and 386 deletions

View File

@@ -30,6 +30,8 @@ import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
import ComponentGlobal_AuthorNameOnHeader from "@/app_modules/component_global/author_name_on_header";
import _ from "lodash";
import { IconCirclePlus } from "@tabler/icons-react";
import ComponentEvent_IsEmptyData from "../component/is_empty_data";
import { useWindowScroll } from "@mantine/hooks";
export default function Event_Beranda({
dataEvent,
@@ -37,21 +39,18 @@ export default function Event_Beranda({
dataEvent: MODEL_EVENT[];
}) {
const router = useRouter();
const [loading, setLoading] = useState(false);
const [isLoading, setLoading] = useState(false);
const [scroll, scrollTo] = useWindowScroll();
// if (_.isEmpty(dataEvent))
// return (
// <Center h={"80vh"}>
// <Text fw={"bold"} fz={"sm"}>
// Tidak Ada Event
// </Text>
// </Center>
// );
return (
<>
<Affix position={{ bottom: rem(150), right: rem(30) }}>
<Affix position={{ bottom: rem(150), right: rem(30) }} zIndex={99}>
<ActionIcon
loading={loading ? true : false}
loading={isLoading ? true : false}
opacity={scroll.y > 0 ? 0.5 : ""}
style={{
transition: "0.5s",
}}
size={"xl"}
radius={"xl"}
variant="transparent"
@@ -64,49 +63,46 @@ export default function Event_Beranda({
<IconCirclePlus color="white" size={40} />
</ActionIcon>
</Affix>
{_.isEmpty(dataEvent) ? (
<Center h={"80vh"}>
<Text fw={"bold"} fz={"sm"}>
Tidak Ada Event
</Text>
</Center>
<ComponentEvent_IsEmptyData text="Tidak ada data" />
) : (
<Box>
{dataEvent.map((e, i) => (
<Card key={e.id} shadow="lg" radius={"md"} withBorder mb={"sm"}>
<Card.Section px={"sm"} pt={"sm"}>
<ComponentGlobal_AuthorNameOnHeader
profileId={e.Author.Profile.id}
imagesId={e.Author.Profile.imagesId}
authorName={e.Author.Profile.name}
/>
</Card.Section>
<Card.Section
p={"sm"}
onClick={() => router.push(RouterEvent.detail_main + e.id)}
>
<Stack>
<Grid>
<Grid.Col span={8}>
<Title order={6} truncate>
{e.title}
</Title>
</Grid.Col>
<Grid.Col span={4}>
<Text fz={"sm"} truncate>
{moment(e.tanggal).format("ll")}
</Text>
</Grid.Col>
</Grid>
{Array(10)
.fill(0)
.map((e, i) => (
<Card key={i} shadow="lg" radius={"md"} withBorder mb={"sm"}>
<Card.Section px={"sm"} pt={"sm"}>
<ComponentGlobal_AuthorNameOnHeader
profileId={e?.Author.Profile.id}
imagesId={e?.Author.Profile.imagesId}
authorName={e?.Author.Profile.name}
/>
</Card.Section>
<Card.Section
p={"sm"}
onClick={() => router.push(RouterEvent.detail_main + e?.id)}
>
<Stack>
<Grid>
<Grid.Col span={8}>
<Title order={6} truncate>
{e?.title}
</Title>
</Grid.Col>
<Grid.Col span={4}>
<Text fz={"sm"} truncate>
{moment(e?.tanggal).format("ll")}
</Text>
</Grid.Col>
</Grid>
<Text fz={"sm"} lineClamp={2}>
{e.deskripsi}
</Text>
</Stack>
</Card.Section>
</Card>
))}
<Text fz={"sm"} lineClamp={2}>
{e?.deskripsi}
</Text>
</Stack>
</Card.Section>
</Card>
))}
</Box>
)}
</>