Skip to content

Commit

Permalink
Merge pull request #69 from taco-official/KL-159/리팩토링
Browse files Browse the repository at this point in the history
fix(KL-159/리팩토링): fix something
  • Loading branch information
seoulyego authored Oct 14, 2024
2 parents 661f759 + b94d25a commit f65c74b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
run: |
yarn install
- name: Set Environment Variables
env:
VITE_APP_API_URL: ${{ secrets.VITE_APP_API_URL }}
VITE_DEFAULT_IMAGE: ${{ secrets.VITE_DEFAULT_IMAGE }}
run: |
echo "VITE_APP_API_URL=${VITE_APP_API_URL}" >> .env
echo "VITE_DEFAULT_IMAGE=${VITE_DEFAULT_IMAGE}" >> .env
- name: Build project
run: yarn build

Expand Down
4 changes: 3 additions & 1 deletion src/components/Navbar/components/LoginButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import useLoginStore from '@stores/useLoginStore'
import PlainButton from '../../Button/PlainButton'
import ProfileImage from '../../UserProfile/ProfileImage'

const defaultImage = import.meta.env.VITE_DEFAULT_IMAGE

export default function LoginButton() {
const { isLogin, loginData } = useLoginStore()
const setModalState = useModalStore((store) => store.setModalState)
Expand All @@ -22,7 +24,7 @@ export default function LoginButton() {
}}
>
<ProfileImage
src={!isLogin ? null : loginData.image?.url}
src={!isLogin ? defaultImage : loginData.image?.url}
$size="2.1875rem"
/>
</PlainButton>
Expand Down
17 changes: 9 additions & 8 deletions src/pages/UserEditPage/ProfileEditBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function ProfileEditBlock({ loginData }) {
setProfile(file)
}

const deleteProfileImage = () => setProfile('')
// const deleteProfileImage = () => setProfile('')

return (
<ProfileEditBlockWrapper>
Expand All @@ -44,18 +44,19 @@ function ProfileEditBlock({ loginData }) {
>
이미지 변경
</StyledButton>
<StyledButton
type="text"
style={{ color: 'red' }}
onClick={deleteProfileImage}
>
삭제
</StyledButton>
</div>
</ProfileEditBlockWrapper>
)
}

// <StyledButton
// type="text"
// style={{ color: 'red' }}
// onClick={deleteProfileImage}
// >
// 삭제
// </StyledButton>

ProfileEditBlock.propTypes = {
loginData: PropTypes.shape({
name: PropTypes.string,
Expand Down
2 changes: 1 addition & 1 deletion src/stores/useFormStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const initialState = {
images: [],
name: '',
description: '',
currencyId: 438,
currencyId: 1,
price: 0,
rating: 0,

Expand Down

0 comments on commit f65c74b

Please sign in to comment.