Skip to content

Commit

Permalink
Update calendar props and demos
Browse files Browse the repository at this point in the history
  • Loading branch information
gucal committed Apr 2, 2024
1 parent 39f84ff commit 6153ef6
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 422 deletions.
57 changes: 57 additions & 0 deletions components/doc/calendar/filleddoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { DocSectionCode } from '@/components/doc/common/docsectioncode';
import { DocSectionText } from '@/components/doc/common/docsectiontext';
import { Calendar } from '@/components/lib/calendar/Calendar';
import { useState } from 'react';

export function FilledDoc(props) {
const [date, setDate] = useState(null);

const code = {
basic: `
<Calendar variant="filled" value={date} onChange={(e) => setDate(e.value)} />
`,
javascript: `
import React, { useState } from "react";
import { Calendar } from 'primereact/calendar';
export default function FilledDemo() {
const [date, setDate] = useState(null);
return (
<div className="card flex justify-content-center">
<Calendar variant="filled" value={date} onChange={(e) => setDate(e.value)} />
</div>
)
}
`,
typescript: `
import React, { useState } from "react";
import { Calendar } from 'primereact/calendar';
import { Nullable } from "primereact/ts-helpers";
export default function FilledDemo() {
const [date, setDate] = useState<Nullable<Date>>(null);
return (
<div className="card flex justify-content-center">
<Calendar variant="filled" value={date} onChange={(e) => setDate(e.value)} />
</div>
)
}
`
};

return (
<>
<DocSectionText {...props}>
<p>
Specify the <i>variant</i> property as <i>filled</i> to display the component with a higher visual emphasis than the default <i>outlined</i> style.
</p>
</DocSectionText>
<div className="card flex justify-content-center">
<Calendar variant="filled" value={date} onChange={(e) => setDate(e.value)} />
</div>
<DocSectionCode code={code} />
</>
);
}
217 changes: 0 additions & 217 deletions components/doc/calendar/form/formikdoc.js

This file was deleted.

Loading

0 comments on commit 6153ef6

Please sign in to comment.