Skip to content

Commit

Permalink
gassless -> gasless 🤦🏾‍♂️
Browse files Browse the repository at this point in the history
  • Loading branch information
DarksightKellar committed Jan 28, 2025
1 parent 71adb05 commit fd8f875
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/components/DaoCreator/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const initialState: CreatorFormState = {
daoName: '',
governance: GovernanceType.AZORIUS_ERC20,
snapshotENS: '',
gasslessVoting: false,
gaslessVoting: false,
},
erc20Token: {
tokenCreationType: TokenCreationType.IMPORTED,
Expand Down
10 changes: 4 additions & 6 deletions src/components/DaoCreator/formComponents/AzoriusGovernance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DETAILS_BOX_SHADOW } from '../../../constants/common';
import { isFeatureEnabled } from '../../../helpers/featureFlags';
import { useDaoInfoStore } from '../../../store/daoInfo/useDaoInfoStore';
import { FractalModuleType, ICreationStepProps, VotingStrategyType } from '../../../types';
import { GasslessVotingToggleDAOCreate } from '../../ui/GasslessVotingToggle';
import { GaslessVotingToggleDAOCreate } from '../../ui/GaslessVotingToggle';
import { BigIntInput } from '../../ui/forms/BigIntInput';
import { CustomNonceInput } from '../../ui/forms/CustomNonceInput';
import { LabelComponent } from '../../ui/forms/InputComponent';
Expand Down Expand Up @@ -257,11 +257,9 @@ export function AzoriusGovernance(props: ICreationStepProps) {
/>
</Box>
)}
<GasslessVotingToggleDAOCreate
isEnabled={values.essentials.gasslessVoting}
onToggle={() =>
setFieldValue('essentials.gasslessVoting', !values.essentials.gasslessVoting)
}
<GaslessVotingToggleDAOCreate
isEnabled={values.essentials.gaslessVoting}
onToggle={() => setFieldValue('essentials.gaslessVoting', !values.essentials.gaslessVoting)}
address="0x01168475f8b9e46f710ff3654cbd9405e8adb421"
/>
<StepButtons
Expand Down
11 changes: 4 additions & 7 deletions src/components/DaoCreator/formComponents/Multisig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MinusCircle, Plus } from '@phosphor-icons/react';
import { Field, FieldAttributes } from 'formik';
import { useTranslation } from 'react-i18next';
import { ICreationStepProps } from '../../../types';
import { GasslessVotingToggleDAOCreate } from '../../ui/GasslessVotingToggle';
import { GaslessVotingToggleDAOCreate } from '../../ui/GaslessVotingToggle';
import { AddressInput } from '../../ui/forms/EthAddressInput';
import { LabelComponent } from '../../ui/forms/InputComponent';
import LabelWrapper from '../../ui/forms/LabelWrapper';
Expand All @@ -12,7 +12,6 @@ import { StepButtons } from '../StepButtons';
import { StepWrapper } from '../StepWrapper';
import useStepRedirect from '../hooks/useStepRedirect';
import { DAOCreateMode } from './EstablishEssentials';

export function Multisig(props: ICreationStepProps) {
const { values, errors, setFieldValue, isSubmitting, transactionPending, isSubDAO, mode } = props;
const { t } = useTranslation('daoCreate');
Expand Down Expand Up @@ -153,11 +152,9 @@ export function Multisig(props: ICreationStepProps) {
</Flex>
</StepWrapper>

<GasslessVotingToggleDAOCreate
isEnabled={values.essentials.gasslessVoting}
onToggle={() =>
setFieldValue('essentials.gasslessVoting', !values.essentials.gasslessVoting)
}
<GaslessVotingToggleDAOCreate
isEnabled={values.essentials.gaslessVoting}
onToggle={() => setFieldValue('essentials.gaslessVoting', !values.essentials.gaslessVoting)}
address="0x01168475f8b9e46f710ff3654cbd9405e8adb421"
/>
<StepButtons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import { isFeatureEnabled } from '../../helpers/featureFlags';
import EtherscanLink from './links/EtherscanLink';
import Divider from './utils/Divider';

interface GasslessVotingToggleProps {
interface GaslessVotingToggleProps {
address?: Address;
balance?: string;
isEnabled: boolean;
onToggle: () => void;
}

function GasslessVotingToggleContent({
function GaslessVotingToggleContent({
isEnabled,
onToggle,
address,
isSettings,
}: GasslessVotingToggleProps & { isSettings?: boolean }) {
}: GaslessVotingToggleProps & { isSettings?: boolean }) {
const { t } = useTranslation('daoCreate');

return (
Expand All @@ -40,17 +40,17 @@ function GasslessVotingToggleContent({
>
<Text textStyle={isSettings ? 'heading-small' : 'helper-text'}>
{isSettings
? t('gasslessVotingLabelSettings', { ns: 'daoEdit' })
: t('gasslessVotingLabel')}
? t('gaslessVotingLabelSettings', { ns: 'daoEdit' })
: t('gaslessVotingLabel')}
</Text>
<Text
textStyle={isSettings ? 'label-large' : 'helper-text'}
color="neutral-7"
w="17.25rem"
>
{isSettings
? t('gasslessVotingDescriptionSettings', { ns: 'daoEdit' })
: t('gasslessVotingDescription')}
? t('gaslessVotingDescriptionSettings', { ns: 'daoEdit' })
: t('gaslessVotingDescription')}
</Text>
</Flex>
<Switch
Expand Down Expand Up @@ -82,10 +82,10 @@ function GasslessVotingToggleContent({
);
}

export function GasslessVotingToggleDAOCreate(props: GasslessVotingToggleProps) {
export function GaslessVotingToggleDAOCreate(props: GaslessVotingToggleProps) {
const { t } = useTranslation('daoCreate');

if (!isFeatureEnabled('flag_gassless_voting')) return null;
if (!isFeatureEnabled('flag_gasless_voting')) return null;

return (
<Box
Expand All @@ -99,7 +99,7 @@ export function GasslessVotingToggleDAOCreate(props: GasslessVotingToggleProps)
boxShadow={DETAILS_BOX_SHADOW}
mt={2}
>
<GasslessVotingToggleContent {...props} />
<GaslessVotingToggleContent {...props} />

<Text textStyle="body-small">
{t('titleBalance', { ns: 'modals' })}:{' '}
Expand All @@ -126,18 +126,18 @@ export function GasslessVotingToggleDAOCreate(props: GasslessVotingToggleProps)
color="lilac-0"
marginLeft="1rem"
>
{t('gasslessVotingGettingStarted')}
{t('gaslessVotingGettingStarted')}
</Text>
</Flex>
</Box>
</Box>
);
}

export function GasslessVotingToggleDAOSettings(props: GasslessVotingToggleProps) {
export function GaslessVotingToggleDAOSettings(props: GaslessVotingToggleProps) {
const { t } = useTranslation('daoEdit');

if (!isFeatureEnabled('flag_gassless_voting')) return null;
if (!isFeatureEnabled('flag_gasless_voting')) return null;

return (
<Box
Expand All @@ -151,7 +151,7 @@ export function GasslessVotingToggleDAOSettings(props: GasslessVotingToggleProps
mx={{ base: '-0.75rem', md: '-1.5rem' }}
/>

<GasslessVotingToggleContent
<GaslessVotingToggleContent
{...props}
isSettings
/>
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/featureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const FEATURE_FLAGS = ['flag_dev', 'flag_gassless_voting', 'flag_yelling'] as const;
export const FEATURE_FLAGS = ['flag_dev', 'flag_gasless_voting', 'flag_yelling'] as const;

export type FeatureFlagKeys = typeof FEATURE_FLAGS;
export type FeatureFlagKey = (typeof FEATURE_FLAGS)[number];
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/locales/en/daoCreate.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"networkDescription": "What network would you like to deploy this DAO on?",
"attachFractalModuleDescription": "This setting controls whether Parent DAO will be able to execute arbitrary transactions on Child DAO bypassing voting process on Child DAO.",
"fractalModuleAttachedDescription": "This setting can not be modified as Fractal Module already attached to the DAO.",
"gasslessVotingLabel": "Gasless Voting",
"gasslessVotingDescription": "Sponsor gas for votes and proposals.",
"gasslessVotingGettingStarted": "To get you started, we're covering your first 0.1 ETH of gas fees. You can top up your balance in your DAO settings, or by sending ETH to this address directly in your wallet."
"gaslessVotingLabel": "Gasless Voting",
"gaslessVotingDescription": "Sponsor gas for votes and proposals.",
"gaslessVotingGettingStarted": "To get you started, we're covering your first 0.1 ETH of gas fees. You can top up your balance in your DAO settings, or by sending ETH to this address directly in your wallet."
}
4 changes: 2 additions & 2 deletions src/i18n/locales/en/daoEdit.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cannotModifyGovernance": "You do not have permissions to modify this Safe's governance.",
"gasslessVotingLabelSettings": "Sponsor Gas",
"gasslessVotingDescriptionSettings": "Fund transaction fees for DAO voters from a shared DAO gas tank.",
"gaslessVotingLabelSettings": "Sponsor Gas",
"gaslessVotingDescriptionSettings": "Fund transaction fees for DAO voters from a shared DAO gas tank.",
"addGas": "Add Gas"
}
4 changes: 2 additions & 2 deletions src/pages/dao/settings/general/SafeGeneralSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { encodeFunctionData, zeroAddress } from 'viem';
import { SettingsContentBox } from '../../../../components/SafeSettings/SettingsContentBox';
import { GasslessVotingToggleDAOSettings } from '../../../../components/ui/GasslessVotingToggle';
import { GaslessVotingToggleDAOSettings } from '../../../../components/ui/GaslessVotingToggle';
import { InputComponent } from '../../../../components/ui/forms/InputComponent';
import { BarLoader } from '../../../../components/ui/loaders/BarLoader';
import NestedPageHeader from '../../../../components/ui/page/Header/NestedPageHeader';
Expand Down Expand Up @@ -213,7 +213,7 @@ export function SafeGeneralSettingsPage() {
mx={{ base: '-0.75rem', md: '-1.5rem' }}
/> */}

<GasslessVotingToggleDAOSettings
<GaslessVotingToggleDAOSettings
isEnabled={false}
onToggle={function (): void {
throw new Error('Function not implemented.');
Expand Down
2 changes: 1 addition & 1 deletion src/types/createDAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export type DAOEssentials = {
daoName: string;
governance: GovernanceType;
snapshotENS: string;
gasslessVoting: boolean;
gaslessVoting: boolean;
};

export type DAOGovernorERC20Token<T = bigint> = {
Expand Down

0 comments on commit fd8f875

Please sign in to comment.