Skip to content

Commit

Permalink
배포 v1.2.0 (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddarkr authored Mar 6, 2024
1 parent c049907 commit 7aca796
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ygtang-client",
"version": "1.1.5",
"version": "1.2.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
14 changes: 8 additions & 6 deletions src/components/home/AppendTooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import { ReactNode, useRef } from 'react';
import { css, Theme } from '@emotion/react';
import { motion, Variants } from 'framer-motion';

Expand All @@ -12,6 +12,7 @@ import { IMAGE_INPUT_ID, ImgUploader } from '../add/ImgUploader';

export default function AppendTooltip() {
const { imgInputUploader } = useImgUpload({ isUploadPage: false });
const inputRef = useRef<HTMLInputElement>(null);

return (
<motion.div css={wrapperCss} variants={tooltipVariants}>
Expand All @@ -20,9 +21,9 @@ export default function AppendTooltip() {
href="/add/image"
icon={<ImageIcon />}
title="이미지"
htmlFor={IMAGE_INPUT_ID}
onClick={() => inputRef.current?.click()}
/>
<ImgUploader imgInputUploader={imgInputUploader} />
<ImgUploader imgInputUploader={imgInputUploader} ref={inputRef} />
<AnchorElement href="/add/link" icon={<LinkIcon />} title="링크" />
</motion.div>
);
Expand All @@ -46,12 +47,13 @@ interface AnchorElementProps {
icon: ReactNode;
title: string;
htmlFor?: string;
onClick?: () => void;
}

function AnchorElement({ href, icon, title, htmlFor }: AnchorElementProps) {
if (htmlFor) {
function AnchorElement({ href, icon, title, htmlFor, onClick }: AnchorElementProps) {
if (htmlFor || onClick) {
return (
<label css={anchorCss} htmlFor={htmlFor}>
<label css={anchorCss} htmlFor={htmlFor} onClick={onClick}>
{icon}
<span>{title}</span>
</label>
Expand Down

0 comments on commit 7aca796

Please sign in to comment.