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

Tes #4493

Merged
merged 13 commits into from
Nov 1, 2024
Merged

Tes #4493

10 changes: 1 addition & 9 deletions src/components/Project/ProjectTabs/ProjectTab.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tab } from '@headlessui/react'
import { ReactNode, useRef } from 'react'
import React, { ReactNode, useRef } from 'react'
import { twMerge } from 'tailwind-merge'

interface ProjectTabProps {
Expand All @@ -26,14 +26,6 @@ export const ProjectTab: React.FC<ProjectTabProps> = ({
onClick={onClick}
>
{({ selected }) => {
if (selected && tabRef.current) {
tabRef.current.scrollIntoView({
behavior: 'smooth',
block: 'nearest',
inline: 'start',
})
}

return (
<div
className={twMerge(
Expand Down
61 changes: 55 additions & 6 deletions src/components/VolumeChart/components/TimelineViewSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,65 @@
import { t } from '@lingui/macro'
import { JuiceListbox } from 'components/inputs/JuiceListbox'
import React from 'react'
import { classNames } from 'utils/classNames'
import { twMerge } from 'tailwind-merge'
import { ProjectTimelineView } from '../types'

export default function TimelineViewSelector({
export default function TimelineViewSelector(props: {
timelineView: ProjectTimelineView
setTimelineView: React.Dispatch<React.SetStateAction<ProjectTimelineView>>
}) {
return (
<>
<MobileTimelineViewSelector {...props} />
<DesktopTimelineViewSelector {...props} />
</>
)
}

const MobileTimelineViewSelector = ({
timelineView,
setTimelineView,
}: {
timelineView: ProjectTimelineView
setTimelineView: React.Dispatch<React.SetStateAction<ProjectTimelineView>>
}) {
}) => {
const opts = (): { label: string; value: ProjectTimelineView }[] => [
{
label: t`Volume`,
value: 'volume',
},
{
label: t`In Juicebox`,
value: 'balance',
},
{
label: t`Trending`,
value: 'trendingScore',
},
]

const handleChange = (value: ProjectTimelineView) => {
setTimelineView(value)
}

return (
<JuiceListbox
className="w-full max-w-[116px] text-xs uppercase md:hidden"
buttonClassName="text-xs uppercase py-1 px-2"
options={opts()}
value={opts().find(o => o.value === timelineView)}
onChange={v => handleChange(v.value)}
/>
)
}

const DesktopTimelineViewSelector = ({
timelineView,
setTimelineView,
}: {
timelineView: ProjectTimelineView
setTimelineView: React.Dispatch<React.SetStateAction<ProjectTimelineView>>
}) => {
const tab = (view: ProjectTimelineView) => {
const selected = view === timelineView

Expand All @@ -28,7 +78,7 @@ export default function TimelineViewSelector({

return (
<div
className={classNames(
className={twMerge(
'cursor-pointer text-sm uppercase',
selected
? 'font-medium text-grey-500 dark:text-slate-100'
Expand All @@ -40,9 +90,8 @@ export default function TimelineViewSelector({
</div>
)
}

return (
<div className="flex gap-3">
<div className="mb-2 hidden gap-3 md:flex">
{tab('volume')}
{tab('balance')}
{tab('trendingScore')}
Expand Down
2 changes: 1 addition & 1 deletion src/components/inputs/FormattedNumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ export default function FormattedNumberInput({
{accessory && <div>{accessory}</div>}
</div>
</div>
);
)
}
27 changes: 20 additions & 7 deletions src/components/strings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Trans } from '@lingui/macro'
import ExternalLink from 'components/ExternalLink'
import Link from 'next/link'
import { v2v3ProjectRoute } from 'packages/v2v3/utils/routes'
import { helpPagePath } from 'utils/helpPagePath'

export const ISSUE_ERC20_EXPLANATION = (
<Trans>
Expand Down Expand Up @@ -29,15 +33,15 @@ export const CYCLE_EXPLANATION = (
supporters.
</p>
<p>
This choice isn't permanent — you can switch between locked and unlocked
cycles in the future.
This choice isn't permanent — you can switch between locked and unlocked rulesets
in the future.
</p>
</Trans>
)

export const RULESET_EXPLANATION = (
<Trans>
<p>With unlocked rulesets, you can edit your project's rules at any time.</p>
<p>With unlocked ruleset cycles, you can edit your project's rules at any time.</p>
<p>
With locked rulesets, you can lock your project's rules for a period of time
(like 3 minutes, 2 years, or 14 days), helping you build trust with your
Expand All @@ -57,10 +61,6 @@ export const LOCKED_PAYOUT_EXPLANATION = (
</Trans>
)

import ExternalLink from 'components/ExternalLink'
import Link from 'next/link'
import { v2v3ProjectRoute } from 'packages/v2v3/utils/routes'
import { helpPagePath } from 'utils/helpPagePath'

export const DISTRIBUTION_LIMIT_EXPLANATION = (
<Trans>
Expand Down Expand Up @@ -216,6 +216,19 @@ export const RECONFIG_RULES_EXPLANATION = (
</Trans>
)

export const DEADLINE_EXPLANATION = (
<Trans>
<p>
Edits to this project must be made before this deadline. This gives token
holders time to verify the edits before they take effect.
</p>
<p>
For example: with a 1-day edit deadline, edits must be made at least 1 day
before a ruleset cycle starts.
</p>
</Trans>
)

export const RECONFIG_RULES_WARN = (
<Trans>
Adding an edit deadline is recommended. Projects with no deadline will
Expand Down
60 changes: 42 additions & 18 deletions src/locales/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ msgstr ""
msgid "Claim {tokensLabel} as ERC-20"
msgstr ""

msgid "Save project"
msgstr ""

msgid "Total issuance"
msgstr ""

Expand Down Expand Up @@ -215,6 +218,9 @@ msgstr ""
msgid "Staked balance"
msgstr ""

msgid "<0>Edits to this project must be made before this deadline. This gives token holders time to verify the edits before they take effect.</0><1>For example: with a 1-day edit deadline, edits must be made at least 1 day before a ruleset cycle starts.</1>"
msgstr ""

msgid "While enabled, the project owner can mint any amount of project tokens."
msgstr ""

Expand All @@ -230,6 +236,9 @@ msgstr ""
msgid "Set a future date & time to start your project's first cycle."
msgstr ""

msgid "Ruleset #1 starts when you create your project. With locked ruleset cycles, if you edit your project's rules during Ruleset #1, those edits will be <0>queued</0> for the next ruleset."
msgstr ""

msgid "No"
msgstr ""

Expand All @@ -242,6 +251,9 @@ msgstr ""
msgid "Amount (USD)"
msgstr ""

msgid "<0>With unlocked ruleset cycles, you can edit your project's rules at any time.</0><1>With locked rulesets, you can lock your project's rules for a period of time (like 3 minutes, 2 years, or 14 days), helping you build trust with your supporters.</1><2>This choice isn't permanent — you can switch between locked and unlocked rulesets in the future.</2>"
msgstr ""

msgid "Payout recipients"
msgstr ""

Expand Down Expand Up @@ -293,6 +305,9 @@ msgstr ""
msgid "Project tokens"
msgstr ""

msgid "NFT Credits"
msgstr ""

msgid "You must grant permission to migrate your V1 tokens."
msgstr ""

Expand Down Expand Up @@ -1001,6 +1016,9 @@ msgstr ""
msgid "Redeem {0} {tokensTextShort} for ETH"
msgstr ""

msgid "<0>With Locked Ruleset Cycles, your project's rules are locked for a period of time.</0><1><2>This helps build trust with your contributors.</2></1>"
msgstr ""

msgid "Are you sure you want to remove {0}?"
msgstr ""

Expand Down Expand Up @@ -1295,6 +1313,9 @@ msgstr ""
msgid "Use NFTs for redemptions"
msgstr ""

msgid "Set a cycle duration for locked rulesets."
msgstr ""

msgid "Assets"
msgstr ""

Expand Down Expand Up @@ -1343,6 +1364,9 @@ msgstr ""
msgid "Need help?"
msgstr ""

msgid "{receivedTokenSymbolText}"
msgstr ""

msgid "Custom strategy"
msgstr ""

Expand Down Expand Up @@ -1451,9 +1475,6 @@ msgstr ""
msgid "<0>Juicebox is a <1>governance-minimal</1> protocol. There are only a few levers that can be tuned, none of which impose changes for users without their consent. The Juicebox governance smart contract can adjust these levers.</0><2>The Juicebox protocol is governed by a community of JBX token holders who vote on proposals fortnightly.</2><3>Juicebox is on-chain and non-custodial. Project creators actually own their projects, and JuiceboxDAO has no way to access project's ETH or change their rules.</3>"
msgstr ""

msgid "<0>With unlocked rulesets, you can edit your project's rules at any time.</0><1>With locked rulesets, you can lock your project's rules for a period of time (like 3 minutes, 2 years, or 14 days), helping you build trust with your supporters.</1><2>This choice isn't permanent — you can switch between locked and unlocked rulesets in the future.</2>"
msgstr ""

msgid "Pay {projectTitle}"
msgstr ""

Expand Down Expand Up @@ -1841,9 +1862,6 @@ msgstr ""
msgid "Project rules"
msgstr ""

msgid "Set a duration for locked rulesets."
msgstr ""

msgid "Upload"
msgstr ""

Expand Down Expand Up @@ -2465,9 +2483,6 @@ msgstr ""
msgid "While enabled, the project owner can change the project's <0>controller</0> at any time."
msgstr ""

msgid "<0>With Locked Rulesets, your project's rules are locked for a period of time.</0><1><2>This helps build trust with your contributors.</2></1>"
msgstr ""

msgid "Ruleset #"
msgstr ""

Expand All @@ -2483,6 +2498,9 @@ msgstr ""
msgid "Read case studies"
msgstr ""

msgid "{days, plural, one {Edits to an upcoming ruleset cycle must be submitted at least # day before that ruleset cycle starts.} other {Edits to an upcoming ruleset cycle must be submitted at least # days before that ruleset cycle starts.}}"
msgstr ""

msgid "tokens"
msgstr ""

Expand Down Expand Up @@ -2807,6 +2825,9 @@ msgstr ""
msgid "We've disabled payments because the project has opted to reserve 100% of new tokens. You would receive no tokens from your payment."
msgstr ""

msgid "Get notifications"
msgstr ""

msgid "Unarchiving your project has the following effects:"
msgstr ""

Expand Down Expand Up @@ -3011,6 +3032,9 @@ msgstr ""
msgid "Your legacy balance"
msgstr ""

msgid "ERC-20"
msgstr ""

msgid "Error loading ETH transfers to project"
msgstr ""

Expand Down Expand Up @@ -3059,6 +3083,9 @@ msgstr ""
msgid "Deploy NFT collection"
msgstr ""

msgid "Edits to upcoming ruleset cycles will take effect when the current cycle ends. A project with no deadline is vulnerable to last-second edits by its owner."
msgstr ""

msgid "You must <0>Edit your Cycle</0> to change your total payout amount."
msgstr ""

Expand Down Expand Up @@ -3200,13 +3227,13 @@ msgstr ""
msgid "Payout total (max.)"
msgstr ""

msgid "Prevent NFT overspending"
msgid "Locked Ruleset Cycles"
msgstr ""

msgid "Yes, start over"
msgid "Prevent NFT overspending"
msgstr ""

msgid "Ruleset #1 starts when you create your project. With locked rulesets, if you edit your project's rules during Ruleset #1, those edits will be <0>queued</0> for the next ruleset."
msgid "Yes, start over"
msgstr ""

msgid "All {tokensText} will go to the project owner:"
Expand Down Expand Up @@ -3392,6 +3419,9 @@ msgstr ""
msgid "New"
msgstr ""

msgid "<0>With unlocked cycles, you can edit your project's rules at any time.</0><1>With locked cycles, you can lock your project's rules for a period of time (like 3 minutes, 2 years, or 14 days), helping you build trust with your supporters.</1><2>This choice isn't permanent — you can switch between locked and unlocked rulesets in the future.</2>"
msgstr ""

msgid "This project has no upcoming ruleset. Its rules can change at any time."
msgstr ""

Expand Down Expand Up @@ -3638,9 +3668,6 @@ msgstr ""
msgid "Redeem {tokensLabel} for ETH"
msgstr ""

msgid "Locked Rulesets"
msgstr ""

msgid "Made a mistake?"
msgstr ""

Expand Down Expand Up @@ -3680,9 +3707,6 @@ msgstr ""
msgid "Request a feature"
msgstr ""

msgid "<0>With unlocked cycles, you can edit your project's rules at any time.</0><1>With locked cycles, you can lock your project's rules for a period of time (like 3 minutes, 2 years, or 14 days), helping you build trust with your supporters.</1><2>This choice isn't permanent — you can switch between locked and unlocked cycles in the future.</2>"
msgstr ""

msgid "I confirm that the use and redemption of crypto tokens is legal in my jurisdiction, and that I am fully responsible for compliance with all relevant laws and regulations."
msgstr ""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Trans } from '@lingui/macro'
import { Divider, Drawer, Space, Tabs } from 'antd'
import { AddToProjectBalanceForm } from 'components/Project/ProjectToolsDrawer/AddToProjectBalanceForm'
import { ExportSection } from 'components/Project/ProjectToolsDrawer/ExportSection'
import { TransferOwnershipForm } from 'components/Project/ProjectToolsDrawer/TransferOwnershipForm'
import { useIsUserAddress } from 'hooks/useIsUserAddress'
import { V1ProjectContext } from 'packages/v1/contexts/Project/V1ProjectContext'
import { useAddToBalanceTx } from 'packages/v1/hooks/transactor/useAddToBalanceTx'
import { useSafeTransferFromTx } from 'packages/v1/hooks/transactor/useSafeTransferFromTx'
import { useSetProjectUriTx } from 'packages/v1/hooks/transactor/useSetProjectUriTx'
import { AddToProjectBalanceForm } from 'packages/v2v3/components/V2V3Project/V2V3ProjectToolsDrawer/AddToProjectBalanceForm'
import { ExportSection } from 'packages/v2v3/components/V2V3Project/V2V3ProjectToolsDrawer/ExportSection'
import { TransferOwnershipForm } from 'packages/v2v3/components/V2V3Project/V2V3ProjectToolsDrawer/TransferOwnershipForm'
import { useContext } from 'react'
import ArchiveV1Project from './ArchiveV1Project'
import { ExportPayoutModsButton } from './ExportPayoutModsButton'
Expand Down
Loading
Loading