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

UI refresh - Header #3

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mbicknese
Copy link

Important

This is a continuation of @barthuigen's work. His PR should be merged before moving forward with this one.

These changes restyle the header to look modern and in line with Kadena's style. Functionality should be the same. Further improvements are some responsive tweaks, the header functions on mobile devices as well as on desktops.

The design is purely what I found pleasing, and I'm open to suggestions.

Desktop

image

Mobile

image

const signed = await signWithChainweaver(transaction);

if (!isSignedCommand(signed)) {
return console.log("Failed to sign transaction");
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it is nicer to throw something, so a visual notification will be displayed to the user in the UI.

if (result.status === "success") {
return result.data.valueOf() as boolean;
} else {
console.log(result.error);
Copy link
Contributor

Choose a reason for hiding this comment

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

we need to handle this situation better, so feedback is displayed in the UI

const client = getClient(API_HOST);
const response = await client.submit(transaction);
console.log("Send response: ", response);
const requestKey = response[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a cleaner way to do this, see the main branch.

<input
onChange={handleInputChange}
value={inputValue}
className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
Copy link
Contributor

Choose a reason for hiding this comment

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

i love tailwind, but I think this way of using it is too similar to using inline css styles, which has its known downsides.

import { Candidate, CandidateProps } from "./Candidate";
import { SpinnerRoundFilled } from "spinners-react";

const candidates: Array<CandidateProps["candidate"]> = [
Copy link
Contributor

Choose a reason for hiding this comment

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

This has been moved to an InMemoryCandidateRepository on the main branch

import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import { ChainWebApiContext } from "./api/api.ts";
import "./index.css";
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe group or sort imports alphabetically or logically.

@jessevanmuijden
Copy link
Contributor

Thank you for your contribution! It would be really nice if the styling would match that of the new docs website where the tutorial lives: https://docs.kadena.io/build/guides/election-dapp-tutorial. @barthuijgen 's PR is no longer up-to-date with main. Your React implementation looks very good. It would be very nice if we could integrate it with the latest structure of the frontend in the main branch. Some parts of that are missing in the branch you branch off of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants