Skip to content

Commit

Permalink
Refactor Header.tsx: import HostListing, remove unused imports, updat…
Browse files Browse the repository at this point in the history
…e layout.
  • Loading branch information
jitunayak committed Aug 26, 2024
1 parent 76d8529 commit a52aaa4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/pages/Hosting/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const HostingHeader: React.FC = () => {
{roomQuery.isSuccess && (
<div
style={{
display: 'inline-flex',
overflowX: 'scroll',
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
width: '100%',
}}
>
Expand Down
17 changes: 10 additions & 7 deletions src/pages/Hosting/HostListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@ const HostListing: React.FC<IProps> = ({ room }) => {
onMouseEnter={() => setisHovered(true)}
onMouseLeave={() => setisHovered(false)}
>
<div
style={{ fontSize: '14px', fontWeight: '500', marginBottom: '1rem' }}
>
{room.name.substring(0, 20)}...
</div>
<Title>{room.name.substring(0, 20)}...</Title>
<img
style={{
borderRadius: '4px',
objectFit: 'cover',
}}
height={300}
src={room.images[0].url}
width={260}
width={'100%'}
/>
<span> {room.price.discountedPrice}</span>
<span>{room.price.discountedPrice}</span>

<AnimatePresence>
{isHovered && (
Expand Down Expand Up @@ -101,3 +97,10 @@ const Card = styled('div', {
padding: '$2',
position: 'relative',
});

const Title = styled('div', {
fontSize: '$s',
fontWeight: '500',
marginBottom: '1rem',
width: '100%',
});

0 comments on commit a52aaa4

Please sign in to comment.