diff --git a/src/components/_common.scss b/src/components/_common.scss new file mode 100644 index 0000000..0de7f4a --- /dev/null +++ b/src/components/_common.scss @@ -0,0 +1,100 @@ +%card { + background-color: white; + border: 1px solid var(--card-outline); + overflow: hidden; + border-radius: 20px; + display: flex; + margin: 20px auto; +} + +%commonIonInput { + font-size: 14px; + color: var(--black); + --padding-top: 5px; + --padding-end: 0; + --padding-bottom: 5px; + --padding-start: 0px; +} + +%formSubmitIonButton { + width: calc(50% - 10px); + display: block; + margin: 0 auto; + height: 40px; + font-size: 13px; + letter-spacing: 0.5px; + + &.cancel { + --border-width: 1px; + --border-color: var(--black); + color: var(--black); + } + + &.approve { + --background: var(--teal); + } + + &.disabled { + pointer-events: none; + filter: grayscale(100%); + } +} + +%commonCardDetailsPopup { + position: fixed; + left: 0; + top: 0; + z-index: 2; + background-color: rgba(0, 0, 0, 0); + width: 100%; + height: 100vh; + display: flex; + align-items: flex-end; + justify-content: stretch; + overflow: auto; + transform: translateY(50vh); + animation: popFromBottom 0.3s forwards; + + @keyframes popFromBottom { + 0% { + transform: translateY(50vh); + } 50% { + transform: translateY(0vh); + background-color: rgba(0, 0, 0, 0); + } 100% { + background-color: rgba(0, 0, 0, 0.6); + transform: translateY(0vh); + } + } + + .cardDetails { + border-top-right-radius: 30px; + border-top-left-radius: 30px; + background-color: white; + width: 100%; + } + + header { + position: relative; + padding: 15px; + + ion-button { + width: 30px; + + svg { + width: 16px; + height: 16px; + color: var(--black); + } + } + + h4 { + font-size: 16px; + text-align: center; + color: var(--black); + font-weight: 500; + width: calc(100% - 60px); + margin-right: auto; + } + } +} \ No newline at end of file diff --git a/src/components/passbook/invoice-card/invoice.module.scss b/src/components/invoice-card/invoice.module.scss similarity index 60% rename from src/components/passbook/invoice-card/invoice.module.scss rename to src/components/invoice-card/invoice.module.scss index ee5a43c..993a171 100644 --- a/src/components/passbook/invoice-card/invoice.module.scss +++ b/src/components/invoice-card/invoice.module.scss @@ -1,6 +1,5 @@ @import '../common'; - .card { @extend %card; @@ -74,7 +73,7 @@ } } - &.overdue { + &.overDue { color: var(--red); &::before { @@ -94,62 +93,7 @@ } .backdrop { - position: fixed; - left: 0; - top: 0; - z-index: 2; - background-color: rgba(0, 0, 0, 0); - width: 100%; - height: 100vh; - display: flex; - align-items: flex-end; - justify-content: stretch; - overflow: auto; - transform: translateY(50vh); - animation: popFromBottom 0.3s forwards; - - @keyframes popFromBottom { - 0% { - transform: translateY(50vh); - } 50% { - transform: translateY(0vh); - background-color: rgba(0, 0, 0, 0); - } 100% { - background-color: rgba(0, 0, 0, 0.6); - transform: translateY(0vh); - } - } - - .cardDetails { - border-top-right-radius: 30px; - border-top-left-radius: 30px; - background-color: white; - width: 100%; - } - - header { - position: relative; - padding: 15px; - - ion-button { - width: 30px; - - svg { - width: 16px; - height: 16px; - color: var(--black); - } - } - - h4 { - font-size: 16px; - text-align: center; - color: var(--black); - font-weight: 500; - width: calc(100% - 60px); - margin-right: auto; - } - } + @extend %commonCardDetailsPopup; ul { padding: 15px; @@ -178,34 +122,34 @@ } } } -} - -.form { - padding: 0 15px; - - .inputHolder { - display: block; - margin: 15px 0; - - label { - text-align: left; - font-size: 11px; - color: var(--grey); - font-weight: 500; - letter-spacing: 0.5px; - } - ion-input { - @extend %commonIonInput; + .form { + padding: 0 15px; + + .inputHolder { + display: block; + margin: 15px 0; + + label { + text-align: left; + font-size: 11px; + color: var(--grey); + font-weight: 500; + letter-spacing: 0.5px; + } + + ion-input { + @extend %commonIonInput; + } } - } - - .buttonsHolder { - margin: 15px 0; - display: flex; - - ion-button { - @extend %formSubmitIonButton; + + .buttonsHolder { + margin: 15px 0; + display: flex; + + ion-button { + @extend %formSubmitIonButton; + } } } } \ No newline at end of file diff --git a/src/components/passbook/invoice-card/invoice.tsx b/src/components/invoice-card/invoice.tsx similarity index 92% rename from src/components/passbook/invoice-card/invoice.tsx rename to src/components/invoice-card/invoice.tsx index 837dfce..9d7e86a 100644 --- a/src/components/passbook/invoice-card/invoice.tsx +++ b/src/components/invoice-card/invoice.tsx @@ -7,9 +7,9 @@ import { IonButton, IonDatetime, IonInput } from '@ionic/react'; type OwnProps = { invoice: { id: string, - date: Date, + date: string, status: string, - dateOfPayment?: Date, + dateOfPayment?: string, referenceNumber?: string, }, client: { @@ -45,7 +45,7 @@ export const InvoiceCard: React.FC = (props) => { default: break; } - return
+ return
setShowDetails(true)}>
logo @@ -74,7 +74,7 @@ export const InvoiceCard: React.FC = (props) => {
  • -

    {format(props.invoice.date, 'dd MMMM yyyy')}

    +

    {format(new Date(props.invoice.date), 'dd MMMM yyyy')}

  • @@ -117,7 +117,7 @@ export const InvoiceCard: React.FC = (props) => { })}>
  • - {props.invoice.status !== 'cancelled' && props.invoice.status !== 'paid' &&
    + {(props.invoice.status !== 'cancelled' && props.invoice.status !== 'paid' || formInputs.dateOfPayment !== props.invoice.dateOfPayment || formInputs.dateOfPayment !== props.invoice.date) &&
    Cancel Invoice setShowDetails(false)}> Paid diff --git a/src/components/passbook/_common.scss b/src/components/passbook/_common.scss deleted file mode 100644 index 859189c..0000000 --- a/src/components/passbook/_common.scss +++ /dev/null @@ -1,42 +0,0 @@ -%card { - background-color: white; - border: 1px solid var(--card-outline); - overflow: hidden; - border-radius: 20px; - display: flex; - margin: 20px auto; -} - - -%commonIonInput { - font-size: 14px; - color: var(--black); - --padding-top: 5px; - --padding-end: 0; - --padding-bottom: 5px; - --padding-start: 0px; -} - -%formSubmitIonButton { - width: calc(50% - 10px); - display: block; - margin: 0 auto; - height: 40px; - font-size: 13px; - letter-spacing: 0.5px; - - &.cancel { - --border-width: 1px; - --border-color: var(--black); - color: var(--black); - } - - &.approve { - --background: var(--teal); - } - - &.disabled { - pointer-events: none; - filter: grayscale(100%); - } -} \ No newline at end of file diff --git a/src/components/passbook/transaction-card/transaction.tsx b/src/components/passbook/transaction-card/transaction.tsx deleted file mode 100644 index 8cec2e9..0000000 --- a/src/components/passbook/transaction-card/transaction.tsx +++ /dev/null @@ -1 +0,0 @@ -export {}; \ No newline at end of file diff --git a/src/components/passbook/transaction-card/transaction.module.scss b/src/components/transaction-card/transaction.module.scss similarity index 100% rename from src/components/passbook/transaction-card/transaction.module.scss rename to src/components/transaction-card/transaction.module.scss diff --git a/src/components/transaction-card/transaction.tsx b/src/components/transaction-card/transaction.tsx new file mode 100644 index 0000000..8941254 --- /dev/null +++ b/src/components/transaction-card/transaction.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import styles from './invoice.module.scss'; +import { format } from 'date-fns'; + + +export const TransactionCard: React.FC = () => { + return
    + +
    +} \ No newline at end of file diff --git a/src/pages/accounts/accounts.module.scss b/src/pages/accounts/accounts.module.scss index d2ddcc6..2e7e5b6 100644 --- a/src/pages/accounts/accounts.module.scss +++ b/src/pages/accounts/accounts.module.scss @@ -24,9 +24,13 @@ } } -.upfold { +.dataBoard { background-color: var(--black); border-bottom-left-radius: 30px; + position: sticky; + position: -webkit-sticky; + top: calc(98px - 255px); + z-index: 1; } .segments { @@ -100,7 +104,7 @@ } } -.actions { +.quickDraw { white-space: nowrap; overflow-x: auto; padding: 15px 20px; @@ -128,34 +132,44 @@ } } -.allTransactionsContainer { +.dashboardContainer { position: relative; background-color: var(--black); -} - -.allTransactions { - background-color: white; - border-top-right-radius: 30px; -} -.transactionCard { - padding: 20px; - box-shadow: 0px 10px 10px -10px var(--light-grey); - - header { - display: flex; - align-items: center; - justify-content: space-between; + &::before { + content: ''; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: white; + border-top-right-radius: 30px; + } - h5 { - font-size: 12px; - font-weight: 500; - color: var(--grey); - } + & > * { + position: relative; + } - a { - color: var(--teal); - font-size: 12px; + .dashboardContainerSegment { + padding: 20px; + box-shadow: 0px 10px 10px -10px var(--light-grey); + + header { + display: flex; + align-items: center; + justify-content: space-between; + + h5 { + font-size: 12px; + font-weight: 500; + color: var(--grey); + } + + a { + color: var(--teal); + font-size: 12px; + } } } } \ No newline at end of file diff --git a/src/pages/accounts/accounts.tsx b/src/pages/accounts/accounts.tsx index a0c4a21..b8ce317 100644 --- a/src/pages/accounts/accounts.tsx +++ b/src/pages/accounts/accounts.tsx @@ -2,12 +2,12 @@ import { IonContent, IonPage } from '@ionic/react'; import { ReactComponent as CogIcon } from 'ionicons/dist/svg/cog-outline.svg'; import { ReactComponent as LineChartIcon } from 'ionicons/dist/svg/stats-chart.svg'; import styles from './accounts.module.scss'; -import { InvoiceCard } from '../../components/passbook/invoice-card/invoice'; +import { InvoiceCard } from '../../components/invoice-card/invoice'; const sampleInvoiceData = [{ invoice: { id: '2021-22/50', - date: new Date(), + date: new Date().toString(), status: 'due', }, client: { @@ -24,10 +24,8 @@ const sampleInvoiceData = [{ }, { invoice: { id: '2021-22/51', - date: new Date(), - status: 'paid', - dateOfPayment: new Date(), - referenceNumber: '23226675560' + date: new Date().toString(), + status: 'over due', }, client: { name: 'TechM', @@ -51,7 +49,8 @@ const Accounts: React.FC = () => { -
    +
    +
    @@ -71,7 +70,7 @@ const Accounts: React.FC = () => { -
      +
      • @@ -95,21 +94,54 @@ const Accounts: React.FC = () => {
    -
    -
    -
    -
    -
    Pending Invoices
    - See All -
    - - {sampleInvoiceData.map((invoice, key) => { - return - })} -
    -
    +
    +
    +
    +
    Pending Invoices
    + See All +
    + + {sampleInvoiceData.map((invoice, key) => { + return + })} +
    + +
    +
    +
    Pending Invoices
    + See All +
    + + {sampleInvoiceData.map((invoice, key) => { + return + })} +
    + +
    +
    +
    Pending Invoices
    + See All +
    + + {sampleInvoiceData.map((invoice, key) => { + return + })} +
    + +
    +
    +
    Pending Invoices
    + See All +
    + + {sampleInvoiceData.map((invoice, key) => { + return + })} +
    + + );