Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Modal Component #5625

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/pages/projects/sistent/components/modal/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import { ModalCode } from "../../../../../sections/Projects/Sistent/components/modal/code";

const ModalCodePage = () => {
return <ModalCode />;
};

export default ModalCodePage;
8 changes: 8 additions & 0 deletions src/pages/projects/sistent/components/modal/guidance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import { ModalGuidance } from "../../../../../sections/Projects/Sistent/components/modal/guidance";

const ModalGuidancePage = () => {
return <ModalGuidance />;
};

export default ModalGuidancePage;
8 changes: 8 additions & 0 deletions src/pages/projects/sistent/components/modal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import SistentModal from "../../../../../sections/Projects/Sistent/components/modal";

const SistentModalPage = () => {
return <SistentModal />;
};

export default SistentModalPage;
7 changes: 7 additions & 0 deletions src/sections/Projects/Sistent/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ const componentsData = [
"A text input is made up of multiple elements that combine to form a component that helps users to read, write, and edit text in an interface.",
url: "/projects/sistent/components/text-input",
},
{
id: 3,
name: "Modal",
description:
"A modal is a container that appears in front of the main content on a page, providing important information or an actionable piece of content for users to execute.",
url: "/projects/sistent/components/modal",
}
];

const SistentComponents = () => {
Expand Down
23 changes: 23 additions & 0 deletions src/sections/Projects/Sistent/components/modal/code-block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { useState } from "react";

export const CodeBlock = ({ name, code }) => {
const [showCode, setShowCode] = useState(false);

const onChange = () => {
setShowCode((prev) => !prev);
};

return (
<div className="show-code">
<input type="checkbox" name={name} id={name} onChange={onChange} />
<label htmlFor={name} className="label">
Show Code
</label>
{showCode && (
<pre className="code">
<code lang="javascript">{code}</code>
</pre>
)}
</div>
);
};
Loading
Loading