Skip to content

Commit

Permalink
Add TextField component to the sistent components page layer5io#5948
Browse files Browse the repository at this point in the history
  • Loading branch information
nooras committed Oct 19, 2024
1 parent bb2f1c8 commit bfd7e4c
Show file tree
Hide file tree
Showing 9 changed files with 1,425 additions and 0 deletions.
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 }) => {
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

0 comments on commit bfd7e4c

Please sign in to comment.