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 Link section documenting the Link component used in Sistent #6012

Closed
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
20 changes: 20 additions & 0 deletions src/pages/projects/sistent/components/link/code-block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React, { useState } from "react";
import Code from "../../../../../components/CodeBlock";

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 && (
<Code codeString={code} language="javascript" />
)}
</div>
);
};
8 changes: 8 additions & 0 deletions src/pages/projects/sistent/components/link/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import { LinkCode } from "../../../../../sections/Projects/Sistent/components/link/code";

const LinkCodePage = () => {
return <LinkCode />;
};

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

const LinkGuidance = () => {
return <LinkGuidancePage />;
};

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

const SistentButtonPage = () => {
return <SistentLink />;
};

export default SistentButtonPage;
9 changes: 9 additions & 0 deletions src/pages/projects/sistent/components/link/link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";

const Link = () => {
return (
<div>Link</div>
);
};

export default Link;
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 @@ -30,6 +30,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/modal",
},
{
id: 4,
name: "Link",
description:
"A link component is a navigational element that directs users to another page or section within an application",
url: "/projects/sistent/components/link",
},
];

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

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 && (
<Code codeString={code} language="javascript" />
)}
</div>
);
};
Loading
Loading