-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
175 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { budgetOptions } from "src/types"; | ||
|
||
function BudgetAmountSelect({ | ||
value, | ||
onChange, | ||
}: { | ||
value?: number; | ||
onChange: (value: number) => void; | ||
}) { | ||
return ( | ||
<div className="grid grid-cols-6 grid-rows-2 md:grid-rows-1 md:grid-cols-6 gap-2 text-xs"> | ||
{Object.keys(budgetOptions).map((budget) => { | ||
const amount = budgetOptions[budget]; | ||
return ( | ||
<div | ||
key={budget} | ||
onClick={() => onChange(amount)} | ||
className={`col-span-2 md:col-span-1 cursor-pointer rounded border-2 ${ | ||
value === amount ? "border-primary" : "border-muted" | ||
} text-center py-4`} | ||
> | ||
{budget} | ||
<br /> | ||
{amount ? "sats" : "#reckless"} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
} | ||
|
||
export default BudgetAmountSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import { | ||
Select, | ||
SelectContent, | ||
SelectItem, | ||
SelectTrigger, | ||
SelectValue, | ||
} from "src/components/ui/select"; | ||
import { BudgetRenewalType, validBudgetRenewals } from "src/types"; | ||
|
||
interface BudgetRenewalProps { | ||
value: BudgetRenewalType; | ||
onChange: (value: BudgetRenewalType) => void; | ||
disabled?: boolean; | ||
} | ||
|
||
const BudgetRenewalSelect: React.FC<BudgetRenewalProps> = ({ | ||
value, | ||
onChange, | ||
disabled, | ||
}) => { | ||
return ( | ||
<Select value={value} onValueChange={onChange} disabled={disabled}> | ||
<SelectTrigger className="w-[150px]"> | ||
<SelectValue placeholder={"placeholder"} /> | ||
</SelectTrigger> | ||
<SelectContent> | ||
{validBudgetRenewals.map((renewalOption) => ( | ||
<SelectItem key={renewalOption} value={renewalOption}> | ||
{renewalOption.charAt(0).toUpperCase() + renewalOption.slice(1)} | ||
</SelectItem> | ||
))} | ||
</SelectContent> | ||
</Select> | ||
); | ||
}; | ||
|
||
export default BudgetRenewalSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.