-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): Significantly improving mobile UI.
- Loading branch information
1 parent
304eec1
commit ea6557e
Showing
21 changed files
with
241 additions
and
55 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
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
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 { ButtonBase, ButtonBaseProps } from '@mui/material'; | ||
import clsx from 'clsx'; | ||
import React from 'react'; | ||
|
||
export interface MButtonProps extends ButtonBaseProps { | ||
|
||
} | ||
|
||
export default function MButton(props: MButtonProps): JSX.Element { | ||
const classNames = clsx( | ||
'bg-purple-700', | ||
'dark:bg-purple-600', | ||
'dark:focus:ring-purple-800', | ||
'dark:hover:bg-purple-700', | ||
'focus:outline-none', | ||
'font-medium', | ||
'hover:bg-purple-800', | ||
'mb-2', | ||
'mr-2', | ||
'px-5', | ||
'py-2.5', | ||
'rounded-lg', | ||
'text-sm', | ||
'text-white', | ||
'w-full', | ||
) | ||
|
||
return <ButtonBase | ||
{ ...props } | ||
className={ classNames } | ||
/>; | ||
} |
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
76 changes: 76 additions & 0 deletions
76
ui/components/Transactions/TransactionsView/TransactionItem.mobile.tsx
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,76 @@ | ||
import { AccessTime } from '@mui/icons-material'; | ||
import classnames from 'classnames'; | ||
import { useSpending } from 'hooks/spending'; | ||
import React, { Fragment } from 'react'; | ||
import { Chip, Divider, ListItem, ListItemAvatar, ListItemButton, ListItemText, Skeleton } from '@mui/material'; | ||
|
||
import TransactionIcon from 'components/Transactions/components/TransactionIcon'; | ||
import Transaction from 'models/Transaction'; | ||
|
||
import 'components/Transactions/TransactionsView/styles/TransactionItem.scss'; | ||
|
||
interface Props { | ||
transaction: Transaction; | ||
} | ||
|
||
export default function TransactionItemMobile(props: Props): JSX.Element { | ||
const spending = useSpending(props.transaction.spendingId) | ||
|
||
function SpentFromLine(): JSX.Element { | ||
if (props.transaction.getIsAddition()) { | ||
return ( | ||
<span className="text-ellipsis overflow-hidden"> | ||
Deposit | ||
</span> | ||
); | ||
} | ||
|
||
if (props.transaction.spendingId && !spending) { | ||
return ( | ||
<span className="text-ellipsis overflow-hidden"> | ||
Spent From <span className="opacity-75">...</span> | ||
</span> | ||
) | ||
} | ||
|
||
const name = spending ? | ||
<span className="text-black font-medium dark:text-white text-ellipsis overflow-hidden"> | ||
{ spending?.name } | ||
</span> : 'Safe-To-Spend'; | ||
|
||
return ( | ||
<span className="text-ellipsis overflow-hidden"> | ||
Spent From { name } | ||
</span> | ||
); | ||
} | ||
|
||
return ( | ||
<Fragment> | ||
<ListItemButton className="pr-0"> | ||
<ListItemAvatar> | ||
<TransactionIcon transaction={ props.transaction }/> | ||
</ListItemAvatar> | ||
<ListItemText | ||
className="flex-initial w-7/12" | ||
primary={ props.transaction.getName() } | ||
secondaryTypographyProps={{ | ||
className: "text-ellipsis overflow-hidden truncate" | ||
}} | ||
secondary={ <SpentFromLine /> } | ||
/> | ||
<div className="flex-1 flex justify-start"> | ||
{ props.transaction.isPending && <AccessTime /> | ||
} | ||
</div> | ||
<span className={ classnames('h-full flex-none amount align-middle self-center justify-end place-self-center text-sm', { | ||
'text-green-600': props.transaction.getIsAddition(), | ||
'text-red-600': !props.transaction.getIsAddition(), | ||
}) }> | ||
<b>{ props.transaction.getAmountString() }</b> | ||
</span> | ||
</ListItemButton> | ||
<Divider /> | ||
</Fragment> | ||
); | ||
} |
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.