Skip to content

Commit

Permalink
Merge pull request #58 from alexanderameye/fix/minor-visual-fixes
Browse files Browse the repository at this point in the history
Minor visual fixes
  • Loading branch information
afadil authored Sep 7, 2024
2 parents d5870c4 + 026f7ff commit 7a777c4
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
Goal,
Trash,
Ungroup,
Upload,
Import,
Users,
ListCollapse,
Wallet,
Expand Down Expand Up @@ -94,7 +94,7 @@ export const Icons = {
WalletCards: WalletCards,
StretchHorizontal: StretchHorizontal,
Menu: TableProperties,
Upload: Upload,
Import: Import,
FileText: FileText,
XCircle: XCircle,
ScrollText: ScrollText,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/activity/activity-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ const ActivityPage = () => {
<div className="flex flex-col p-6">
<ApplicationHeader heading="Activity">
<div className="flex items-center space-x-2">
<Button variant="outline" size="icon" title="Import" asChild>
<Button variant="outline" size="sm" title="Import" asChild>
<Link to={'/import'}>
<Icons.Upload className="h-4 w-4" />
<Icons.Import className="h-4 w-4" />
<span className="sr-only">Import</span>
</Link>
</Button>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/activity/components/activity-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ const AssetActivityFields = ({ defaultAssetId }: AssetActivityFieldsProps) => {
<FormItem>
<FormLabel>Shares</FormLabel>
<FormControl>
<Input type="number" inputMode="decimal" placeholder="Shares" {...field} />
<Input type="number" inputMode="decimal" min="0" placeholder="Shares" {...field} />
</FormControl>
<FormMessage />
</FormItem>
Expand All @@ -382,7 +382,7 @@ const AssetActivityFields = ({ defaultAssetId }: AssetActivityFieldsProps) => {
<FormItem>
<FormLabel>Price</FormLabel>
<FormControl>
<Input type="number" inputMode="decimal" placeholder="Price" {...field} />
<Input type="number" inputMode="decimal" min="0" placeholder="Price" {...field} />
</FormControl>
<FormMessage />
</FormItem>
Expand All @@ -395,7 +395,7 @@ const AssetActivityFields = ({ defaultAssetId }: AssetActivityFieldsProps) => {
<FormItem>
<FormLabel>Fee</FormLabel>
<FormControl>
<Input type="number" inputMode="decimal" placeholder="Fee" {...field} />
<Input type="number" inputMode="decimal" min="0" placeholder="Fee" {...field} />
</FormControl>
<FormMessage />
</FormItem>
Expand Down
11 changes: 7 additions & 4 deletions src/pages/activity/components/ticker-search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ function TickerSearchInput({ selectedResult, defaultValue, onSelectResult }: Sea
const tickers = data?.sort((a, b) => b.score - a.score);

return (
<Command
shouldFilter={false}
className="h-auto w-full rounded-lg border border-b-0 shadow-none"
>
<Command
shouldFilter={false}
className={cn(
'h-auto w-full rounded-lg border shadow-none',
{ 'border-b-0': !isLoading && !isError && !(tickers && tickers.length > 0) }
)}
>
<CommandInput
value={searchQuery}
onValueChange={setSearchQuery}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/activity/import/import-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const ActivityImportForm = ({ onSuccess, onError }: ActivityImportFormPro
</>
) : (
<>
<EmptyPlaceholder.Icon name="Upload" />
<EmptyPlaceholder.Icon name="Import" />
<EmptyPlaceholder.Title>
Drag and drop your CSV file here
</EmptyPlaceholder.Title>
Expand All @@ -212,7 +212,7 @@ export const ActivityImportForm = ({ onSuccess, onError }: ActivityImportFormPro
</>
) : (
<>
<Icons.Upload className="mr-2 h-4 w-4" />
<Icons.Import className="mr-2 h-4 w-4" />
<span className="hidden sm:ml-2 sm:inline">Import activities</span>
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/activity/import/import-validation-alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ValidationAlert: React.FC<ValidationAlertProps> = ({
</>
) : (
<>
<Icons.Upload className="mr-2 h-4 w-4" />
<Icons.Import className="mr-2 h-4 w-4" />
<span className="hidden sm:ml-2 sm:inline">Confirm Import</span>
</>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/holdings/components/income-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export function IncomeDashboard() {
const totalIncome = incomeSummary.total_income;
const dividendIncome = incomeSummary.by_type['DIVIDEND'] || 0;
const interestIncome = incomeSummary.by_type['INTEREST'] || 0;
const dividendPercentage = (dividendIncome / totalIncome) * 100;
const interestPercentage = (interestIncome / totalIncome) * 100;
const dividendPercentage = (dividendIncome / totalIncome) * 100 || 0;
const interestPercentage = (interestIncome / totalIncome) * 100 || 0;

// Filter out interest and only keep dividend income for top stocks
const topDividendStocks = Object.entries(incomeSummary.by_symbol)
Expand Down

0 comments on commit 7a777c4

Please sign in to comment.