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

Add TextField component to the sistent components page #5948 #6008

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 15 additions & 0 deletions src/components/SistentNavigation/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,19 @@ export const content = [
link: "/projects/sistent/components/text-input/code",
text: "Text Input",
},
{
id: 15,
link: "/projects/sistent/components/text-field",
text: "Text Field",
},
{
id: 16,
link: "/projects/sistent/components/text-field/guidance",
text: "Text Field",
},
{
id: 17,
link: "/projects/sistent/components/text-field/code",
text: "Text Field",
},
];
8 changes: 8 additions & 0 deletions src/pages/projects/sistent/components/text-field/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react";
import { TextFieldCode } from "../../../../../sections/Projects/Sistent/components/text-field/code";

const TextFieldCodePage = () => {
return <TextFieldCode />;
};

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

const TextFieldGuidancePage = () => {
return <TextFieldGuidance />;
};

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

const SistentTextFieldPage = () => {
return <SistentTextField />;
};

export default SistentTextFieldPage;
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: "Text Field",
description:
"The TextField component is a versatile input field used to capture user input in forms and user interfaces.",
url: "/projects/sistent/components/text-field",
}
];

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nooras isn't code block component already there then why creating new?

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