-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed the layout in product page
- Loading branch information
1 parent
0af1c3d
commit 537e962
Showing
18 changed files
with
344 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
import { NextPage } from 'next' | ||
import { NextSeo } from 'next-seo' | ||
import Container from 'src/components/atoms/Container/Container' | ||
import TripGuide from 'src/components/organisms/TripGuide/TripGuide' | ||
import Link from 'src/components/atoms/Link/Link' | ||
|
||
const ErrorPage: NextPage = () => <div>404</div> | ||
const NotFoundPage: NextPage = () => ( | ||
<div> | ||
<NextSeo | ||
title='NotFound page - Ikea clone | Karthick Ragavendran' | ||
description='Create account with your email or google account.' | ||
/> | ||
<div className='min-h-screen mt-12'> | ||
<Container className='flex flex-col justify-center h-full'> | ||
<div className='max-w-sm'> | ||
<div className='text-lg font-semibold'>404 | Page not found.</div> | ||
<div className='mt-8 mb-16 text-gray-600'> | ||
Meanwhile, follow the <span className='text-red'>site map</span>{' '} | ||
below for amazing things you can do in this site right now. | ||
</div> | ||
</div> | ||
<TripGuide /> | ||
</Container> | ||
</div> | ||
</div> | ||
) | ||
|
||
export default ErrorPage | ||
export default NotFoundPage |
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,52 @@ | ||
import React from 'react' | ||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
import Image from './Image' | ||
|
||
export default { | ||
title: 'atoms/Image', | ||
component: Image, | ||
} as ComponentMeta<typeof Image> | ||
|
||
const Template: ComponentStory<typeof Image> = (args) => ( | ||
<Image alt='' {...args} /> | ||
) | ||
|
||
export const Fixed = Template.bind({}) | ||
Fixed.args = { | ||
src: 'https://via.placeholder.com/200', | ||
className: 'border border-black', | ||
height: 100, | ||
width: 250, | ||
alt: '', | ||
layout: 'fixed', | ||
} | ||
|
||
export const Intrinsic = Template.bind({}) | ||
Intrinsic.args = { | ||
src: 'https://via.placeholder.com/200', | ||
className: 'border border-black', | ||
height: 100, | ||
width: 250, | ||
alt: '', | ||
layout: 'intrinsic', | ||
} | ||
|
||
export const Fill = Template.bind({}) | ||
Fill.args = { | ||
src: 'https://via.placeholder.com/200', | ||
className: 'border border-black', | ||
height: 100, | ||
width: 250, | ||
alt: '', | ||
layout: 'fill', | ||
} | ||
|
||
export const Responsive = Template.bind({}) | ||
Responsive.args = { | ||
src: 'https://via.placeholder.com/200', | ||
className: 'border border-black', | ||
height: 100, | ||
width: 250, | ||
alt: '', | ||
layout: 'responsive', | ||
} |
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,16 @@ | ||
import React from 'react' | ||
import { mount } from '@cypress/react' | ||
import Image from './Image' | ||
|
||
describe('Image Component', () => { | ||
it('Image renders', () => { | ||
mount( | ||
<Image | ||
src='https://via.placeholder.com/150' | ||
blurDataURL='https://via.placeholder.com/10' | ||
layout='fill' | ||
alt='' | ||
/> | ||
) | ||
}) | ||
}) |
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,36 @@ | ||
/* eslint-disable react/jsx-props-no-spreading */ | ||
import NextImage, { ImageProps } from 'next/image' | ||
|
||
const Image = ({ | ||
className, | ||
src, | ||
width = 240, | ||
height = 240, | ||
layout = 'responsive', | ||
alt = '', | ||
quality = 75, | ||
...props | ||
}: ImageProps) => { | ||
const imgWidth = layout === 'fill' ? undefined : width | ||
const imgHeight = layout === 'fill' ? undefined : height | ||
const imgSrc = | ||
src || | ||
'https://res.cloudinary.com/thankyou/image/upload/v1649599416/IKEA/nopicture_fi31cv.jpg' | ||
|
||
return ( | ||
<NextImage | ||
className={`object-cover ${className}`} | ||
src={imgSrc} | ||
width={imgWidth} | ||
height={imgHeight} | ||
layout={layout} | ||
alt={alt} | ||
quality={quality} | ||
placeholder='blur' | ||
blurDataURL='/images/blur.png' | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
export default Image |
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,3 @@ | ||
import Image from './Image' | ||
|
||
export default Image |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,41 @@ | ||
import React from 'react' | ||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
import userReducer, { | ||
initialState as userInitialState, | ||
} from 'src/store/user/userSlice' | ||
import { Provider } from 'react-redux' | ||
import { combineReducers, createStore } from '@reduxjs/toolkit' | ||
import produce from 'immer' | ||
import TripGuide from './TripGuide' | ||
|
||
const reducers = { user: userReducer } | ||
|
||
const stateWithUid = produce(userInitialState, (userDraft) => { | ||
// @ts-ignore | ||
userDraft.data.user?.uid = '123' | ||
}) | ||
|
||
const store = createStore(combineReducers(reducers), { | ||
user: userInitialState, | ||
}) | ||
const storeWithUid = createStore(combineReducers(reducers), { | ||
user: stateWithUid, | ||
}) | ||
|
||
export default { | ||
title: 'organisms/TripGuide', | ||
component: TripGuide, | ||
} as ComponentMeta<typeof TripGuide> | ||
|
||
const Template: ComponentStory<typeof TripGuide> = () => <TripGuide /> | ||
|
||
export const UnAuthenticated = Template.bind({}) | ||
UnAuthenticated.args = {} | ||
UnAuthenticated.decorators = [ | ||
(story) => <Provider store={store}>{story()}</Provider>, | ||
] | ||
export const Authenticated = Template.bind({}) | ||
Authenticated.args = {} | ||
Authenticated.decorators = [ | ||
(story) => <Provider store={storeWithUid}>{story()}</Provider>, | ||
] |
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,8 @@ | ||
import { mount } from '@cypress/react' | ||
import TripGuide from './TripGuide' | ||
|
||
describe('TripGuide Component', () => { | ||
it('TripGuide renders', () => { | ||
mount(<TripGuide />) | ||
}) | ||
}) |
Oops, something went wrong.
537e962
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
zillow-clone-safe – ./
zillow-clone-safe-git-main-iamkarthick.vercel.app
zillow-clone-safe.vercel.app
zillow-clone-safe-iamkarthick.vercel.app
zillow.iamkarthick.com