Skip to content

Commit bf26795

Browse files
feat(docs): update refine hr showcase images (#6361)
1 parent 8be95d8 commit bf26795

File tree

1 file changed

+90
-49
lines changed

1 file changed

+90
-49
lines changed

documentation/src/refine-theme/landing-hero-showcase-section.tsx

Lines changed: 90 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -416,24 +416,25 @@ const ShowcaseHR = ({ className }: { className?: string }) => {
416416
return (
417417
<ShowcaseWrapper
418418
className={className}
419-
render="https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr/base_render.png"
419+
render="https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr2/base_render.png"
420420
highlights={[
421421
{
422-
x: 268,
423-
y: 184,
424-
width: 496,
425-
height: 260,
422+
x: 244,
423+
y: 254,
424+
width: 520,
425+
height: 296,
426426
render:
427-
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr/inbox.png",
427+
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr2/notifications.png",
428428
codePosition: "right",
429429
code: `
430430
import { useList } from "@refinedev/core";
431431
432432
const { data } = useList({
433433
resource: "notifications",
434+
liveMode: "auto",
434435
filters: [
435436
{
436-
field: "is_read",
437+
field: "isRead",
437438
operator: "eq",
438439
value: false
439440
},
@@ -444,65 +445,105 @@ const ShowcaseHR = ({ className }: { className?: string }) => {
444445
{
445446
x: 12,
446447
y: 174,
447-
width: 200,
448-
height: 344,
448+
width: 204,
449+
height: 360,
449450
render:
450-
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr/sider.png",
451+
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr2/menu.png",
451452
codePosition: "right",
452453
code: `
453-
import { useMenu } from "@refinedev/core";
454-
import Link from "next/link";
455-
456-
const { menuItems } = useMenu();
457-
458-
return menuItems.map((item) => (
459-
<Link to={item.route}>
460-
{item.icon}
461-
{item.label}
462-
</Link>
463-
));
464-
`,
454+
import { useMenu, Link, CanAccess } from "@refinedev/core";
455+
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText } from "@mui/material";
456+
457+
const Sider = () => {
458+
const { menuItems, selectedKey } = useMenu();
459+
return (
460+
<List>
461+
{menuItems.map((item) => (
462+
<CanAccess key={item.key} action="list" resource={item.name}>
463+
<ListItem>
464+
<ListItemButton component={Link} selected={selectedKey === item.key} to={item.route}>
465+
<ListItemIcon>{item.icon}</ListItemIcon>
466+
<ListItemText>{item.label}</ListItemText>
467+
</ListItemButton>
468+
</ListItem>
469+
</CanAccess>
470+
))}
471+
</List>
472+
);
473+
};
474+
`,
465475
},
466476
{
467477
x: 788,
468-
y: 184,
469-
width: 332,
470-
height: 260,
478+
y: 254,
479+
width: 356,
480+
height: 296,
471481
render:
472-
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr/poll.png",
482+
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr2/poll.png",
473483
codePosition: "left",
474484
code: `
475-
import { useList } from "@refinedev/core";
485+
import { useList } from "@refinedev/core";
476486
477-
const { data } = useList({
478-
resource: "polls",
479-
filters: [
480-
{ field: "is_active", operator: "eq", value: true },
481-
],
482-
pagination: { current: 1, pageSize: 1 }
483-
});
487+
const { data } = useList({
488+
resource: "polls",
489+
filters: [{ field: "status", operator: "eq", value: "active" }],
490+
pagination: { current: 1, pageSize: 1 },
491+
liveMode: "auto",
492+
});
484493
`,
485494
},
486495
{
487-
x: 736,
488-
y: 24,
489-
width: 384,
490-
height: 112,
496+
x: 978,
497+
y: 22,
498+
width: 166,
499+
height: 36,
491500
render:
492-
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr/timer.png",
501+
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr2/request-time-off.png",
493502
codePosition: "left",
494503
code: `
495-
import { useGetIdentity, useUpdate } from "@refinedev/core";
496-
497-
const { data: { activeTaskId } } = useGetIdentity();
504+
import { CreateButton } from "@refinedev/mui";
505+
import { TimeOffIcon } from "@/icons";
498506
499-
const { mutate } = useUpdate();
500-
501-
const onBreak = () => mutate({
502-
resource: "tasks",
503-
id: activeTaskId,
504-
values: { is_paused: true },
505-
});
507+
<CreateButton resource="time-offs" startIcon={<TimeOffIcon />}>
508+
Request Time Off
509+
</CreateButton>
510+
`,
511+
},
512+
{
513+
x: 552,
514+
y: 78,
515+
width: 284,
516+
height: 128,
517+
render:
518+
"https://refine.ams3.cdn.digitaloceanspaces.com/website/static/showcase-images/hr2/sick-leave.png",
519+
codePosition: "left",
520+
code: `
521+
import { useGetIdentity, useList } from "@refinedev/core";
522+
523+
const { data: { employeeId } } = useGetIdentity();
524+
525+
const { data } = useList({
526+
resource: "time-offs",
527+
pagination: { current: 1, pageSize: 1 },
528+
filters: [
529+
{
530+
field: "employeeId",
531+
operator: "eq",
532+
value: employeeId,
533+
},
534+
{
535+
field: "status",
536+
operator: "eq",
537+
value: "approved",
538+
},
539+
{
540+
field: "type",
541+
operator: "eq",
542+
value: "sick-leave",
543+
},
544+
],
545+
});
546+
const totalSickLeave = data?.total;
506547
`,
507548
},
508549
]}

0 commit comments

Comments
 (0)