Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
BuyankhuuTsCAl committed Apr 8, 2024
1 parent ebd3dea commit d8e7177
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/orderHistory/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function OrderHistory() {
<NavBarMovedUP />
<OutterBox>
<BackButton destination="./profileScreen" />
<h1>Order History</h1>
<Heading1>Order History</Heading1>
<OrderHistoryContainer>
{orderIds.length > 0 ? (
orderIds.map((orderId: number) => (
Expand Down
2 changes: 0 additions & 2 deletions src/app/orderPage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export default function OrderPage() {
<OutterBox>
<BackButtonDiv>
<BackButton destination="./orderHistory" />
<BackButton destination="./orderHistory" />
</BackButtonDiv>
<OutterDiv>
<Heading>{formatDate(order?.created_at)}</Heading>
Expand All @@ -93,7 +92,6 @@ export default function OrderPage() {
<Body1Bold>{order?.status}</Body1Bold>{' '}
</StatusButton>
</OutterDiv>

<OutterFavoriteDiv>
{orders.map(product => (
<FavoriteDiv key={product.id}>
Expand Down
26 changes: 22 additions & 4 deletions src/app/profileScreen/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Body2Bold,
Body1,
Body2,
Heading4,
} from '@/styles/fonts';
import {
addOrRemoveProductFromFavorite,
Expand Down Expand Up @@ -154,15 +155,15 @@ function OrderHistorySection(props: { Orders: Order[] }) {
backgroundColor = '#CEE8BE';
} else if (Orders[0].status === 'Rejected') {
backgroundColor = '#FFDDDD';
} else if (Orders[0].status === 'Completed') {
} else if (Orders[0].status === 'Confirmed') {
backgroundColor = '#C7DDFF';
}
let icon;
if (Orders[0].status === 'Submitted') {
icon = <CheckCircle />;
} else if (Orders[0].status === 'Rejected') {
icon = <X />;
} else if (Orders[0].status === 'Completed') {
} else if (Orders[0].status === 'Confirmed') {
icon = <Check />;
} else {
icon = null;
Expand All @@ -172,7 +173,7 @@ function OrderHistorySection(props: { Orders: Order[] }) {
<OrderHistory>
<HeaderDiv>
<Heading2>Order History</Heading2>
<ViewAllButton destination="./orderPage" />
<ViewAllButton destination="./orderHistory" />
</HeaderDiv>
<div
style={{
Expand Down Expand Up @@ -241,7 +242,24 @@ function OrderHistorySection(props: { Orders: Order[] }) {
</main>
);
}
return null;
return (
<main>
<OrderHistory>
<HeaderDiv>
<Heading2>Order History</Heading2>
<ViewAllButton destination="./orderHistory" />
</HeaderDiv>
<div
style={{
marginTop: '20px',
width: '100%',
}}
>
<Heading4>No Current Orders to Display</Heading4>
</div>
</OrderHistory>
</main>
);
}
function AccountDetailSectionDelivery(props: { user: User }) {
const { user } = props;
Expand Down
6 changes: 3 additions & 3 deletions src/components/OrderHistory/OrderHistoryText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function OrderDetails(props: OrderDetailsProps) {
const queryString = querystring.stringify({ orderID });
router.push(`/orderPage?${queryString}`);
};
if (order.status === OrderStatus.OrderRejected) {
if (order.status === OrderStatus.Rejected) {
return (
<div
style={{
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function OrderDetails(props: OrderDetailsProps) {
</div>
);
}
if (order.status === OrderStatus.OrderReady) {
if (order.status === OrderStatus.Complete) {
return (
<div
style={{
Expand Down Expand Up @@ -122,7 +122,7 @@ export default function OrderDetails(props: OrderDetailsProps) {
</div>
);
}
if (order.status === OrderStatus.OrderSubmitted) {
if (order.status === OrderStatus.Submitted) {
return (
<div
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type User = {

export enum OrderStatus {
Submitted = 'Submitted',
Complete = 'Completed',
Complete = 'Confirmed',
Rejected = 'Rejected',
}

Expand Down

0 comments on commit d8e7177

Please sign in to comment.