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

feat: welcome screen for example app #100

Merged
merged 2 commits into from
Feb 20, 2024
Merged
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
2 changes: 2 additions & 0 deletions GETTING_STARTED_WEB_CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ useEffect(() => {

### Example Usage
Visit [example-web/my-app](./example-web/my-app/src/App.js) to see example.

Visit [Live Demo](https://signify-browser-extension.vercel.app/) for production demo.
4 changes: 4 additions & 0 deletions example-web/my-app/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
color: white;
}

.Welcome {
width: 600px;
}

.App-link {
color: #61dafb;
}
Expand Down
18 changes: 10 additions & 8 deletions example-web/my-app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import "./App.css";

function App() {
const [signifyData, setSignifyData] = useState();
const [parsedSignifyData, setParsedSignifyData] = useState();

const fetchData = () => {
const data = localStorage.getItem("signify-data");
if (data) {
setSignifyData(data);
setParsedSignifyData(JSON.parse(data));
}
};

Expand All @@ -40,25 +42,25 @@ function App() {
const removeData = () => {
localStorage.removeItem("signify-data");
setSignifyData(null);
setParsedSignifyData(null);
};

return (
<div className="App">
<header className="App-header">
{signifyData ? (
<div className="w-full p-4">
<div>
<label
htmlFor="message"
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>
Signify Header Data
<div className="Welcome">
<div className="">
<h3>Welcome!</h3>
<label htmlFor="message" className="">
Signed in with{" "}
{parsedSignifyData?.credential ? "Credential" : "AID"}
</label>
<textarea
id="message"
rows="16"
defaultValue={signifyData}
className="block p-2.5 w-full text-black text-sm rounded-lg border border-gray-300"
className="w-full block p-2.5 text-black text-sm rounded-lg border border-gray-300"
placeholder="Write your thoughts here..."
></textarea>
</div>
Expand Down