-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from One-Click-Auth/kdiffin
added card working and WIP code section in showcase
- Loading branch information
Showing
11 changed files
with
966 additions
and
506 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React, { useState } from "react"; | ||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter"; | ||
|
||
interface CodeTabsProps {} | ||
|
||
const CodeTabs: React.FC<CodeTabsProps> = () => { | ||
const [activeTab, setActiveTab] = useState("python"); | ||
|
||
const handleTabClick = (tab: string) => { | ||
setActiveTab(tab); | ||
}; | ||
|
||
const getCode = () => { | ||
switch (activeTab) { | ||
case "python": | ||
return ` | ||
def trust_authx(): | ||
# Python code | ||
pass | ||
`; | ||
case "javascript": | ||
return ` | ||
function trustAuth() { | ||
// JavaScript code | ||
} | ||
`; | ||
case "go": | ||
return ` | ||
func TrustAuthX() { | ||
// Go code | ||
} | ||
`; | ||
default: | ||
return ""; | ||
} | ||
}; | ||
|
||
return ( | ||
<div className=""> | ||
<div className="flex space-x-2"> | ||
<button | ||
className={`px-4 py-2 rounded ${ | ||
activeTab === "python" ? "bg-gray-300" : "bg-gray-200" | ||
}`} | ||
onClick={() => handleTabClick("python")} | ||
> | ||
Trustauthx.py | ||
</button> | ||
<button | ||
className={`px-4 py-2 rounded ${ | ||
activeTab === "javascript" ? "bg-gray-300" : "bg-gray-200" | ||
}`} | ||
onClick={() => handleTabClick("javascript")} | ||
> | ||
Auth.js | ||
</button> | ||
<button | ||
className={`px-4 py-2 rounded ${ | ||
activeTab === "go" ? "bg-gray-300" : "bg-gray-200" | ||
}`} | ||
onClick={() => handleTabClick("go")} | ||
> | ||
Trustauthx.go | ||
</button> | ||
</div> | ||
|
||
<div className="mt-4"> | ||
<SyntaxHighlighter language="javascript" showLineNumbers> | ||
{getCode()} | ||
</SyntaxHighlighter> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CodeTabs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import CodeTabs from "../components/showcase/CodeTabs"; | ||
import React from "react"; | ||
|
||
function REAL() { | ||
return ( | ||
<div> | ||
<CodeTabs /> | ||
</div> | ||
); | ||
} | ||
|
||
export default REAL; |
Oops, something went wrong.