Skip to content

Commit bbbb82a

Browse files
committed
Merge branch 'feature/#2533-example-proposal-templates' into feature/#2533-sablier-and-transfer-template
2 parents 7c72f99 + fd0f3e1 commit bbbb82a

File tree

12 files changed

+58
-37
lines changed

12 files changed

+58
-37
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "decent-interface",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"private": true,
55
"dependencies": {
66
"@amplitude/analytics-browser": "^2.11.1",

public/images/hero_image.png

36.1 KB
Loading

src/assets/css/Toast.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
margin-right: 0;
3232
}
3333

34+
.sonner-toast[data-type='loading'] [data-icon] {
35+
margin-top: 8px;
36+
}
37+
3438
.sonner-toast [data-icon] svg {
3539
width: 24px;
3640
height: 24px;

src/components/ProposalBuilder/ProposalMetadata.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FormikProps } from 'formik';
33
import { useTranslation } from 'react-i18next';
44
import { CreateProposalForm, ProposalBuilderMode } from '../../types/proposalBuilder';
55
import { InputComponent, TextareaComponent } from '../ui/forms/InputComponent';
6+
import { builderInProposalMode } from './constants';
67

78
export interface ProposalMetadataProps extends FormikProps<CreateProposalForm> {
89
mode: ProposalBuilderMode;
@@ -14,8 +15,7 @@ export default function ProposalMetadata({
1415
mode,
1516
}: ProposalMetadataProps) {
1617
const { t } = useTranslation(['proposalTemplate', 'proposal', 'common']);
17-
const isProposalMode =
18-
mode === ProposalBuilderMode.PROPOSAL || mode === ProposalBuilderMode.PROPOSAL_WITH_ACTIONS;
18+
const isProposalMode = builderInProposalMode(mode);
1919

2020
return (
2121
<VStack

src/components/ProposalBuilder/ProposalTransaction.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import {
2-
VStack,
3-
HStack,
4-
Text,
2+
Accordion,
3+
AccordionButton,
4+
AccordionItem,
5+
AccordionPanel,
56
Box,
67
Flex,
8+
HStack,
79
IconButton,
8-
Accordion,
9-
AccordionPanel,
10-
AccordionItem,
11-
AccordionButton,
1210
Radio,
11+
Text,
12+
VStack,
1313
} from '@chakra-ui/react';
14-
import { Plus, MinusCircle, CaretDown, CaretRight } from '@phosphor-icons/react';
14+
import { CaretDown, CaretRight, MinusCircle, Plus } from '@phosphor-icons/react';
1515
import { useCallback, useState } from 'react';
1616
import { useTranslation } from 'react-i18next';
1717
import { CreateProposalTransaction, ProposalBuilderMode } from '../../types/proposalBuilder';
@@ -21,7 +21,7 @@ import ExampleLabel from '../ui/forms/ExampleLabel';
2121
import { BigIntComponent, InputComponent } from '../ui/forms/InputComponent';
2222
import CeleryButtonWithIcon from '../ui/utils/CeleryButtonWithIcon';
2323
import Divider from '../ui/utils/Divider';
24-
import { DEFAULT_PROPOSAL_TRANSACTION } from './constants';
24+
import { builderInProposalMode, DEFAULT_PROPOSAL_TRANSACTION } from './constants';
2525

2626
interface ProposalTransactionProps {
2727
transaction: CreateProposalTransaction;
@@ -42,7 +42,7 @@ export default function ProposalTransaction({
4242
setFieldValue,
4343
mode,
4444
}: ProposalTransactionProps) {
45-
const isProposalMode = mode === ProposalBuilderMode.PROPOSAL;
45+
const isProposalMode = builderInProposalMode(mode);
4646
const { t } = useTranslation(['proposal', 'proposalTemplate', 'common']);
4747
const [expandedIndecies, setExpandedIndecies] = useState<number[]>([0]);
4848

@@ -193,7 +193,7 @@ export default function ProposalTransaction({
193193
setFieldValue(
194194
`transactions.${transactionIndex}.parameters`,
195195
transaction.parameters.filter(
196-
(parameterToRemove, parameterToRemoveIndex) =>
196+
(_parameterToRemove, parameterToRemoveIndex) =>
197197
parameterToRemoveIndex !== i,
198198
),
199199
)

src/components/ProposalBuilder/constants.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
import { CreateProposalTransaction, Stream, Tranche } from '../../types/proposalBuilder';
1+
import {
2+
CreateProposalTransaction,
3+
ProposalBuilderMode,
4+
Stream,
5+
Tranche,
6+
} from '../../types/proposalBuilder';
7+
8+
export const builderInProposalMode = (mode: ProposalBuilderMode) =>
9+
mode === ProposalBuilderMode.PROPOSAL ||
10+
mode === ProposalBuilderMode.PROPOSAL_WITH_ACTIONS ||
11+
mode === ProposalBuilderMode.SABLIER ||
12+
mode === ProposalBuilderMode.PROPOSAL_FROM_TEMPLATE;
213

314
export const DEFAULT_PROPOSAL_TRANSACTION: CreateProposalTransaction = {
415
targetAddress: '',

src/components/ProposalBuilder/index.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import ProposalMetadata from './ProposalMetadata';
3131
import { ProposalStreams } from './ProposalStreams';
3232
import ProposalTransactionsForm from './ProposalTransactionsForm';
3333
import StepButtons from './StepButtons';
34+
import { builderInProposalMode } from './constants';
3435

3536
interface ProposalBuilderProps {
3637
mode: ProposalBuilderMode;
@@ -53,8 +54,8 @@ export function ProposalBuilder({
5354
const step = (paths[paths.length - 1] || paths[paths.length - 2]) as
5455
| CreateProposalSteps
5556
| undefined;
56-
const isProposalMode =
57-
mode === ProposalBuilderMode.PROPOSAL || mode === ProposalBuilderMode.PROPOSAL_WITH_ACTIONS;
57+
const isProposalMode = builderInProposalMode(mode);
58+
const isSablierMode = mode === ProposalBuilderMode.SABLIER;
5859

5960
const {
6061
governance: { isAzorius },
@@ -218,13 +219,13 @@ export function ProposalBuilder({
218219
/>
219220
<Route
220221
path={
221-
mode === ProposalBuilderMode.SABLIER
222+
isSablierMode
222223
? CreateProposalSteps.STREAMS
223224
: CreateProposalSteps.TRANSACTIONS
224225
}
225226
element={
226227
<>
227-
{mode === ProposalBuilderMode.SABLIER ? (
228+
{isSablierMode ? (
228229
<ProposalStreams
229230
pendingTransaction={pendingCreateTx}
230231
{...formikProps}

src/constants/common.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const MAX_CONTENT_WIDTH = '80rem';
5656

5757
const features = {
5858
developmentMode: 'DEVELOPMENT_MODE',
59-
termedRoles: 'TERMED_ROLES',
6059
demoMode: 'DEMO_MODE',
6160
} as const;
6261

@@ -72,7 +71,6 @@ export const isFeatureEnabled = (feature: FeatureFlag) => {
7271
};
7372

7473
export const isDevMode = () => isFeatureEnabled(features.developmentMode);
75-
export const isTermedRolesEnabled = () => isFeatureEnabled(features.termedRoles);
7674
export const isDemoMode = () => isFeatureEnabled(features.demoMode);
7775

7876
/**

src/hooks/DAO/loaders/governance/useAzoriusProposals.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ export const useAzoriusProposals = () => {
234234

235235
let proposalData;
236236

237+
if (
238+
proposalCreatedEvent.args.proposer === undefined ||
239+
proposalCreatedEvent.args.strategy === undefined
240+
) {
241+
continue;
242+
}
243+
237244
if (proposalCreatedEvent.args.metadata && proposalCreatedEvent.args.transactions) {
238245
const metadataEvent = parseProposalMetadata(proposalCreatedEvent.args.metadata);
239246

@@ -273,13 +280,6 @@ export const useAzoriusProposals = () => {
273280
}
274281
}
275282

276-
if (
277-
proposalCreatedEvent.args.proposer === undefined ||
278-
proposalCreatedEvent.args.strategy === undefined
279-
) {
280-
continue;
281-
}
282-
283283
let strategyType: VotingStrategyType | undefined;
284284
const strategyAddress = proposalCreatedEvent.args.strategy;
285285
const {

0 commit comments

Comments
 (0)