Skip to content

Commit

Permalink
Merge pull request #72 from sprint-team3/dev
Browse files Browse the repository at this point in the history
Deploy version 0.1.2
  • Loading branch information
grapefruit13 authored Apr 18, 2024
2 parents 59b8f3c + 7a35014 commit 987444b
Show file tree
Hide file tree
Showing 57 changed files with 215 additions and 52 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
106 changes: 106 additions & 0 deletions src/components/buttons/IconButton.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
$dot-size: 0.1rem;

%frame-base {
@include flexbox;

position: relative;
border-radius: 9.9rem;
}

.icon-button {
@extend %frame-base;

border: 0.1rem solid $opacity-white-20;
}

.frame {
&-outer {
&-small {
width: 4.2rem;
height: 4.2rem;
}

&-medium {
width: 5.6rem;
height: 5.6rem;
}

&-large {
width: 8rem;
height: 8rem;
}
}

&-inner {
@extend %frame-base;

overflow: hidden;

width: 3.2rem;
height: 3.2rem;

background-color: $opacity-white-10;
border: 0.1rem solid $white;

&-small {
width: 3.2rem;
height: 3.2rem;
}

&-medium {
width: 4.2rem;
height: 4.2rem;
}

&-large {
width: 6.4rem;
height: 6.4rem;
}

&-activated {
border-color: $primary;
}
}
}

.image {
@include image-fit;
}

.dot {
position: absolute;

width: $dot-size;
height: $dot-size;

background-color: $white;
border-radius: 50%;

&-top {
@include pos-center-x;

top: -$dot-size;
}

&-right {
@include pos-center-y;

right: -$dot-size;
}

&-bottom {
@include pos-center-x;

bottom: -$dot-size;
}

&-left {
@include pos-center-y;

left: -$dot-size;
}

&-activated {
background-color: $primary;
}
}
37 changes: 37 additions & 0 deletions src/components/buttons/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { RefObject } from 'react';

import classNames from 'classnames/bind';

import styles from './IconButton.module.scss';

const cx = classNames.bind(styles);

type IconButtonProps = {
imageUrl: string;
imageAlt: string;
isActivated: boolean;
onClick: () => void;
buttonRef?: RefObject<HTMLButtonElement>;
size?: 'small' | 'medium' | 'large';
};

export const IconButton = ({
imageUrl,
imageAlt,
isActivated,
onClick,
buttonRef,
size = 'medium',
}: IconButtonProps) => {
return (
<button className={cx('icon-button', `frame-outer-${size}`)} onClick={onClick} ref={buttonRef}>
<div className={cx('dot', 'dot-top', { 'dot-activated': isActivated })}></div>
<div className={cx('dot', 'dot-right', { 'dot-activated': isActivated })}></div>
<div className={cx('dot', 'dot-bottom', { 'dot-activated': isActivated })}></div>
<div className={cx('dot', 'dot-left', { 'dot-activated': isActivated })}></div>
<div className={cx('frame-inner', `frame-inner-${size}`, { 'frame-inner-activated': isActivated })}>
<img className={cx('image')} src={imageUrl} alt={imageAlt} />
</div>
</button>
);
};
1 change: 1 addition & 0 deletions src/components/buttons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './OperationButton';
export * from './CardButton';
export * from './HeaderSigninButton';
export * from './HeaderSignupButton';
export * from './IconButton';
6 changes: 2 additions & 4 deletions src/components/inputs/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import classNames from 'classnames/bind';
import searchIcon from '@/assets/ic-search.svg';
import { SVGS } from '@/constants';

import searchIcon from '../../assets/ic-search.svg';

import styles from './SearchBar.module.scss';

const cx = classNames.bind(styles);

const { alt } = SVGS.search;
const { url, alt } = SVGS.search;

type SearchBarType = {
placeholder: string;
Expand All @@ -35,7 +33,7 @@ export const SearchBar = ({ placeholder, onChange, color = 'purple', maxLength =
onChange={(event) => handleChange(event)}
/>
<div className={cx('searchbar-search-icon')}>
<img className={cx('searchbar-search-icon-img')} src={searchIcon} alt={alt} />
<img className={cx('searchbar-search-icon-img')} src={url} alt={alt} />
</div>
</div>
);
Expand Down
Loading

0 comments on commit 987444b

Please sign in to comment.