Skip to content

Commit

Permalink
Merge branch 'main' into stepan/deprecate-dynamo
Browse files Browse the repository at this point in the history
  • Loading branch information
stepandel committed Apr 10, 2024
2 parents c1e9319 + da09486 commit 1006c86
Show file tree
Hide file tree
Showing 32 changed files with 368 additions and 319 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI
run-name: ${{ github.actor }} - ${{ github.event_name }} - ${{ github.repository }}
on:
pull_request:
branches:
- 'main'
push:
branches:
- 'main'

jobs:
lint-prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Lint with Prettier
run: yarn check-prettier
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"cypress": "cypress open",
"generate-typechain": "typechain --target ethers-v6 --out-dir src/lib/contracts/generated src/lib/contracts/abis/*.json",
"typecheck": "tsc --pretty --noEmit",
"generate-apikey": "ts-node src/scripts/generateApiKey.ts"
"generate-apikey": "ts-node src/scripts/generateApiKey.ts",
"check-prettier": "prettier --check src/"
},
"dependencies": {
"@babel/core": "^7.0.0-0",
Expand Down Expand Up @@ -90,6 +91,7 @@
"@types/react-infinite-scroller": "^1.2.5",
"@types/uuid": "^9.0.8",
"cypress": "^12.11.0",
"prettier": "^3.2.5",
"sass": "^1.62.1",
"ts-node": "^10.9.2",
"typechain": "^8.3.2",
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/common/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const createOptionalStringValidator = <T extends string>(
const literals = inputs.map((x) => z.literal(x)) as unknown as readonly [
z.ZodLiteral<T>,
z.ZodLiteral<T>,
...z.ZodLiteral<T>[]
...z.ZodLiteral<T>[],
];
return z
.union([
Expand Down
2 changes: 1 addition & 1 deletion src/app/changelog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Page() {
Stay up to date with the latest changes with Agora&apos;s
development. Please report bugs and feedback{" "}
<a
href="https://app.deform.cc/form/7180b273-7662-4f96-9e66-1eae240a52bc/"
href="https://agora.deform.cc/bugreport/"
className="font-semibold text-indigo-600 hover:text-indigo-500"
>
using this form
Expand Down
8 changes: 4 additions & 4 deletions src/components/Admin/ProposalType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ export default function ProposalType({
Number(e.target.value) > 100
? 100
: Number(e.target.value) < 0
? 0
: Number(e.target.value)
? 0
: Number(e.target.value)
);
}}
/>
Expand Down Expand Up @@ -213,8 +213,8 @@ export default function ProposalType({
Number(e.target.value) > 100
? 100
: Number(e.target.value) < 0
? 0
: Number(e.target.value)
? 0
: Number(e.target.value)
);
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/BetaBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function BetaBanner() {
feedback{" "}
<a
rel="noopener"
href="https://app.deform.cc/form/7180b273-7662-4f96-9e66-1eae240a52bc/"
href="https://agora.deform.cc/bugreport/"
target="_blank"
className="underline"
>
Expand Down
31 changes: 18 additions & 13 deletions src/components/Header/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@ export default function Navbar() {

return (
<HStack className={styles.main_nav}>
{tenant.ui.toggle("proposals") && tenant.ui.toggle("proposals").enabled && (
<HeaderLink
href="/"
isActive={pathname.includes("proposals") || pathname === "/"}
>
Proposals
</HeaderLink>
)}
{tenant.ui.toggle("proposals") &&
tenant.ui.toggle("proposals").enabled && (
<HeaderLink
href="/"
isActive={pathname.includes("proposals") || pathname === "/"}
>
Proposals
</HeaderLink>
)}

{tenant.ui.toggle("delegates") && tenant.ui.toggle("delegates").enabled && (
<HeaderLink href="/delegates" isActive={pathname.includes("delegates")}>
Voters
</HeaderLink>
)}
{tenant.ui.toggle("delegates") &&
tenant.ui.toggle("delegates").enabled && (
<HeaderLink
href="/delegates"
isActive={pathname.includes("delegates")}
>
Voters
</HeaderLink>
)}

{tenant.ui.toggle("retropgf") && tenant.ui.toggle("retropgf").enabled && (
<HeaderLink
Expand Down
2 changes: 1 addition & 1 deletion src/components/Layout/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as theme from "@/styles/theme";

type Props = {
className?: string;
gap?: keyof typeof theme["spacing"];
gap?: keyof (typeof theme)["spacing"];
justifyContent?:
| "justify-around"
| "justify-between"
Expand Down
21 changes: 18 additions & 3 deletions src/components/Metrics/DAOMetricsHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function DAOMetricsHeader({ metrics }) {
const [isClient, setIsClient] = useState(false);
const [visible, setVisible] = useState(false);

const governanceForumLink = ui.link("governanceForum");
const bugsLink = ui.link("bugs");
const changeLogLink = ui.link("changelog");
const faqLink = ui.link("faq");
Expand Down Expand Up @@ -45,7 +46,7 @@ export default function DAOMetricsHeader({ metrics }) {
)}
>
<div
className="w-full sm:w-2/3 flex items-center px-6 sm:px-8 gap-8 justify-between sm:justify-start h-10"
className="w-full sm:w-3/5 flex items-center px-6 sm:px-8 gap-8 justify-between sm:justify-start h-10"
onClick={() => setVisible(!visible)}
>
<div className="flex gap-6 sm:gap-8">
Expand All @@ -65,24 +66,38 @@ export default function DAOMetricsHeader({ metrics }) {
/>
</div>
<div className="block bg-gray-eo w-full sm:w-[1px] h-[1px] sm:h-10"></div>
<div className="w-full sm:w-1/3 flex justify-start sm:justify-center items-center px-6 sm:px-8 gap-4 h-10">
<div className="w-full sm:w-2/5 flex justify-start sm:justify-center items-center px-6 sm:px-8 gap-4 h-10">
{governanceForumLink && (
<a
href={governanceForumLink.url}
rel="noreferrer nonopener"
target="_blank"
className="text-center"
>
{governanceForumLink.title}
</a>
)}
{bugsLink && (
<a
href={bugsLink.url}
rel="noreferrer nonopener"
target="_blank"
className="text-center"
>
{bugsLink.title}
</a>
)}
{changeLogLink && (
<Link href={changeLogLink.url}>{changeLogLink.title}</Link>
<Link href={changeLogLink.url} className="text-center">
{changeLogLink.title}
</Link>
)}
{faqLink && (
<a
href={faqLink.url}
rel="noreferrer nonopener"
target="_blank"
className="text-center"
>
{faqLink.title}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export default function OptionsResultsPanel({
return BigInt(b.votes || 0) > BigInt(a.votes || 0)
? 1
: BigInt(b.votes || 0) < BigInt(a.votes || 0)
? -1
: 0;
? -1
: 0;
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export default function OpManagerDeleteProposal({
{isLoading
? "Loading..."
: isSuccess
? "Proposal deleted"
: "Delete proposal"}
? "Proposal deleted"
: "Delete proposal"}
</Button>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Votes/VoteText/VoteText.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default function VoteText({ support }) {
support === "FOR"
? "voted for"
: support === "AGAINST"
? "voted against"
: "abstained";
? "voted against"
: "abstained";

return <p className={className}>{supportText}</p>;
}
4 changes: 2 additions & 2 deletions src/components/shared/SimulateTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export default function SimulateTransaction({
status === "Valid"
? styles.valid
: status === "Invalid"
? styles.invalid
: styles.else_color
? styles.invalid
: styles.else_color
}
>
{status}
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Form = FormProvider;

type FormFieldContextValue<
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> = {
name: TName;
};
Expand All @@ -28,7 +28,7 @@ const FormFieldContext = React.createContext<FormFieldContextValue>(

const FormField = <
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
>({
...props
}: ControllerProps<TFieldValues, TName>) => {
Expand Down
8 changes: 4 additions & 4 deletions src/hooks/useAdvancedVoting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ const useAdvancedVoting = ({
? "castVoteWithReasonAndParams"
: "castVoteWithReason"
: params
? "castVoteWithReasonAndParams"
: "castVote",
? "castVoteWithReasonAndParams"
: "castVote",
args: reason
? params
? [BigInt(proposalId), support, reason, params]
: [BigInt(proposalId), support, reason]
: params
? [BigInt(proposalId), support, reason, params]
: ([BigInt(proposalId), support] as any),
? [BigInt(proposalId), support, reason, params]
: ([BigInt(proposalId), support] as any),
chainId: optimism.id,
});

Expand Down
Loading

0 comments on commit 1006c86

Please sign in to comment.