Skip to content

Commit

Permalink
feat(ESI): initiated the earth support init. forest app for deployement
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketceminds committed Nov 19, 2024
1 parent 8684830 commit 0cc8ad8
Show file tree
Hide file tree
Showing 112 changed files with 10,172 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/earth-support-initiative/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules/
/coverage/
/.next/
/public/
29 changes: 29 additions & 0 deletions apps/earth-support-initiative/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pipeline {
agent any
stages {
stage('Executing Shell Script On Server') {
steps {
script {
sshagent(credentials: ['"${credentials}"']) {
sh '''
ssh -t -t ${userName}@${hostIP} -o StrictHostKeyChecking=no << EOF
${listOfCommands}
logout
EOF
'''
}
}
}
}
}
post {
always {
cleanWs(cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE'],
[pattern: '.propsfile', type: 'EXCLUDE']])
}
}
}
153 changes: 153 additions & 0 deletions apps/earth-support-initiative/components/cart/cart-item.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
.cart_item_layout_container {
display: flex;
align-items: center;
flex-wrap: wrap;
padding-left: 0.5rem;
padding-right: 0.5rem;
border-bottom: 2px solid #e3e8ef;
margin-bottom: 1.5rem;

@media (min-width: 640px) {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
}
}

.prouct_details_container {
width: 100%;
@media (min-width: 1024px) {
/* width: 50%; */
}

@media (min-width: 640px) {
/* min-width: 480px; */
}
}

.product_details {
display: flex;
flex-wrap: wrap;

@media (min-width: 640px) {
flex-wrap: nowrap;
}
@media (min-width: 640px) and (max-width: 1024px) {
display: block;
}

justify-content: center;
align-items: center;
flex-grow: 1;
}

.product_image_container {
width: 80px;
height: 100%;
margin-bottom: 20px;
@media (min-width: 640px) and (max-width: 1024px) {
margin: 0 auto;
}
}

.product_name {
display: flex;
font-size: 0.875rem;
font-weight: 600;
margin-bottom: 0.5rem;
direction: ltr;
font-size: 17px;
margin-left: 0.5rem;
margin-right: 0.5rem;
width: 100%;
text-align: center;
padding-top: 0.25rem;

@media (min-width: 640px) {
margin-bottom: 8px;
}
}

.product_count_price_container {
display: flex;
flex-wrap: wrap;
flex-grow: 1;
margin-bottom: 1.5rem;

@media (min-width: 768px) {
align-items: center;
}

@media (min-width: 640px) {
margin-bottom: 0;
}
}

.product_counter_layout_container {
flex-grow: 1;
margin-top: 0.5rem;
margin-bottom: 0.5rem;

@media (min-width: 640px) {
margin-top: 0;
margin-bottom: 0;
}
}

.product_counter_container {
display: flex;
align-items: center;
justify-content: flex-start;
cursor: pointer;

@media (min-width: 1024px) {
justify-content: center;
}
}

.plus_icon_container {
padding: 0.5rem;
}

.plus_icon {
font-size: 1rem;
}

.product_counter_input {
display: inline-block;
width: 65px;
padding-right: 7px;
padding-left: 7px;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
margin-left: 0.25rem;
margin-right: 0.25rem;
border: 1px solid #d1d5db;
text-align: center;
border-radius: 0.25rem;
}

.delete_icon_container,
.minus_icon_container {
padding: 0.25rem;
}

.delete_icon {
font-size: 1.3rem;
color: red;
}

.minus_icon {
font-size: 1rem;
}

.total_amount_container {
display: flex;
flex-direction: column;
flex-grow: 1;
font-weight: normal;
margin-left: 0.25rem;
margin-right: 0.25rem;
font-size: 15px;
}
41 changes: 41 additions & 0 deletions apps/earth-support-initiative/components/cart/cart-item.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import DetailsCard from '@beckn-ui/becknified-components/src/components/checkout/details-card'
import { Typography } from '@beckn-ui/molecules'
import { CardBody, Stack } from '@chakra-ui/react'
import React from 'react'

// Custom modules
import Styles from './cart-item.module.css'
import { CartItemProps } from './cart.types'

const CartItem: React.FC<CartItemProps> = ({ id, shortDesc, providerName, sourceText, className }) => {
return (
<div
className={className}
data-test="cart-list"
>
<div className={Styles.prouct_details_container}>
<a>
<DetailsCard key={id}>
<CardBody padding={'unset'}>
<Stack>
<Typography
fontSize="15px"
fontWeight={'600'}
text={shortDesc}
/>

<Typography
fontSize="12px"
fontWeight={'400'}
text={`Provided by ${providerName}`}
/>
</Stack>
</CardBody>
</DetailsCard>
</a>
</div>
</div>
)
}

export default CartItem
12 changes: 12 additions & 0 deletions apps/earth-support-initiative/components/cart/cart-list.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.cart_list_container {
width: 100%;

@media (min-width: 1280px) {
max-width: 2100px;
margin: 0 auto;
}
}

.cart_item {
margin: 3% 0;
}
28 changes: 28 additions & 0 deletions apps/earth-support-initiative/components/cart/cart-list.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react'

//Custom
import { CartListProps, CartItemProps } from './cart.types'
import CartItem from './cart-item'
import Styles from './cart-list.module.css'

const CartList: React.FC<CartListProps> = ({ cartItems }) => {
return (
<div style={{ width: '100%' }}>
<div className={Styles.cart_list_container}>
{cartItems.length !== 0
? cartItems.map((cartItem: CartItemProps) => {
return (
<CartItem
key={cartItem.id}
className={Styles.cart_item}
{...cartItem}
/>
)
})
: null}
</div>
</div>
)
}

export default CartList
20 changes: 20 additions & 0 deletions apps/earth-support-initiative/components/cart/cart.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.empty_cart_text {
margin-top: 5rem;
text-align: center;
color: #7e88c3;
font-weight: normal;
}

.cart_list_comp_container {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
position: relative;
max-width: 131.25rem;
margin: 0 auto;

@media (min-width: 768px) {
max-width: 60%;
}
}
104 changes: 104 additions & 0 deletions apps/earth-support-initiative/components/cart/cart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import React from 'react'
import cl from 'classnames'
import { Box, Flex, Image } from '@chakra-ui/react'

// Custom
import { CartProps } from './cart.types'
import CartList from './cart-list'
import Styles from './cart.module.css'
import { Loader, Typography, Button as BecknButton, Button } from '@beckn-ui/molecules'

const Cart: React.FC<CartProps> = ({
schema: { loader, cartItems, actionButton, emptyCard }, // Destructure props
isLoading = false,
emptyText = 'Empty cart',
className
}) => {
if (isLoading) {
return (
<Box
display="flex"
height="calc(100vh - 160px)"
justifyContent="center"
alignItems={'center'}
>
<Loader {...loader} />
</Box>
)
}

return (
<Box className={cl(`${className}`, Styles.cart_list_comp_container)}>
<>
{cartItems.length === 0 && emptyCard && (
<Flex
flexDir={'column'}
columnGap={'10px'}
justifyContent={'center'}
mt={'100px'}
data-test="empty-card"
>
<Flex
justifyContent={'center'}
alignItems={'center'}
mb={'30px'}
>
<Image
src={emptyCard.image}
alt="empty-card"
data-test={emptyCard.dataTestImage}
/>
</Flex>
<Box
textAlign={'center'}
mb={'20px'}
>
<Typography
variant="titleSemibold"
dataTest={emptyCard.dataTestHeading}
text={emptyCard.heading!}
/>
<Typography
variant="subTitleRegular"
dataTest={emptyCard.dataTestSubHeading}
text={emptyCard.subHeading!}
/>
</Box>
<BecknButton
dataTest={emptyCard.dataTestCta}
text={emptyCard.buttonText}
handleClick={emptyCard.buttonHanler}
/>
</Flex>
)}
{cartItems.length > 0 && (
<>
<Box
textAlign={'left'}
mb={'20px'}
width={'100%'}
>
<Typography
variant="subTitleRegular"
text="Request Overview"
/>
<CartList cartItems={cartItems} />
</Box>
<Box
w="307px"
mr="20px"
alignSelf={'start'}
>
<Button
text={actionButton?.text}
handleClick={actionButton?.handleOnClick}
/>
</Box>
</>
)}
</>
</Box>
)
}

export default Cart
Loading

0 comments on commit 0cc8ad8

Please sign in to comment.