Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat/#300] 링크 복사하기 버튼, link tooltip 구현 #301

Closed
wants to merge 12 commits into from
Closed
1 change: 0 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components",
"stylelint-config-prettier",
"stylelint-config-concentric-order"
],
"overrides": [
Expand Down
3 changes: 2 additions & 1 deletion src/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ChooseBestTime from 'pages/bestMeetTime/ChooseBestTime';
import CompleteCreateMeeting from 'pages/completeCreateMeeting/CompleteCreateMeeting';
import CreateMeeting from 'pages/createMeeting/CreateMeeting';
import CueCard from 'pages/cueCard/CueCard';
import ErrorPage404 from 'pages/errorLoading/ErrorPage404';
Expand All @@ -15,7 +16,7 @@ const Router = () => {
<Routes>
<Route path="/" element={<OnBoarding />} />
<Route path="/meet/create" element={<CreateMeeting />} />
<Route path="/meet/complete" element={<SteppingLayout steppingType={'meetComplete'} />} />
<Route path="/meet/complete/:meetingId" element={<CompleteCreateMeeting />} />
<Route path="/:auth/select/:meetingId" element={<SelectSchedule />} />
<Route
path="/host/schedule-complete/:meetingId"
Expand Down
5 changes: 5 additions & 0 deletions src/assets/svgs/linkTooltip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/svgs/tooltipArrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 23 additions & 19 deletions src/components/Icon/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ReactComponent as HambergerIc } from 'assets/svgs/hambergerIcon.svg';
import { ReactComponent as InputCancelIc } from 'assets/svgs/inputCancelBtn.svg';
import { ReactComponent as InputErrorIc } from 'assets/svgs/inputErrorBtn.svg';
import { ReactComponent as LinkIc } from 'assets/svgs/linkIcon.svg';
import { ReactComponent as LinkTooltipIc } from 'assets/svgs/linkTooltip.svg';
import { ReactComponent as MainLogoIc } from 'assets/svgs/mainLogo.svg';
import { ReactComponent as OfflinePlaceIc } from 'assets/svgs/offlinePlace.svg';
import { ReactComponent as OnlinePlaceIc } from 'assets/svgs/onlinePlace.svg';
Expand All @@ -23,33 +24,36 @@ import { ReactComponent as RadioCheckIc } from 'assets/svgs/radioCheck.svg';
import { ReactComponent as RadioCheckedIc } from 'assets/svgs/radioChecked.svg';
import { ReactComponent as SpeechBubbleIc } from 'assets/svgs/speechBubble.svg';
import { ReactComponent as TimeIc } from 'assets/svgs/time.svg';
import { ReactComponent as TooltipArrowIc } from 'assets/svgs/tooltipArrow.svg';
import { ReactComponent as Wave } from 'assets/svgs/wave.svg';

export {
MainLogoIc,
HambergerIc,
ExitIc,
InputCancelIc,
RadioCheckIc,
RadioCheckedIc,
BackIc,
PlusIc,
InputErrorIc,
Circle1Ic,
Circle2Ic,
Circle3Ic,
ClockIc,
DropDownIc,
DropdownWhite,
DropUpIc,
PasswordOpenEyeIc,
PasswordEyeIc,
DropupWhite,
ExitIc,
HambergerIc,
InputCancelIc,
InputErrorIc,
LinkIc,
PlaceIc,
ClockIc,
OnlinePlaceIc,
LinkTooltipIc,
MainLogoIc,
OfflinePlaceIc,
TimeIc,
DropdownWhite,
DropupWhite,
OnlinePlaceIc,
PasswordEyeIc,
PasswordOpenEyeIc,
PlaceIc,
PlusIc,
RadioCheckedIc,
RadioCheckIc,
SpeechBubbleIc,
TimeIc,
TooltipArrowIc,
Wave,
Circle1Ic,
Circle2Ic,
Circle3Ic,
};
4 changes: 2 additions & 2 deletions src/components/atomComponents/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css, styled } from 'styled-components';

import React from 'react';

import { css, styled } from 'styled-components';

interface ButtonProps {
children: React.ReactNode;
typeState: string;
Expand Down
47 changes: 47 additions & 0 deletions src/components/atomComponents/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { TooltipArrowIc } from 'components/Icon/icon';
import styled from 'styled-components';

interface TooltipPropTypes {
tooltipText: string;
}
const Tooltip = ({ tooltipText }: TooltipPropTypes) => {
return (
<TooltipWrapper>
<TooltioArrowIcon />
<ToolTipTextWrapper>{tooltipText}</ToolTipTextWrapper>
</TooltipWrapper>
);
};

const TooltipWrapper = styled.div`
cursor: default;
position: absolute;

top: 6rem;
width: 8.1rem;
height: 2.8rem;
left: 50%;
transform: translate(-50%, -50%);
`;
const TooltioArrowIcon = styled(TooltipArrowIc)`
position: absolute;
left: 50%;
transform: translate(-50%, -50%);
`;

const ToolTipTextWrapper = styled.div`
position: absolute;
display: flex;
justify-content: center;
align-items: center;
width: 8.1rem;
height: 2.8rem;

border-radius: 6px;
background-color: ${({ theme }) => theme.colors.grey9};

color: ${({ theme }) => theme.colors.grey5};

${({ theme }) => theme.fonts.body4};
`;
export default Tooltip;
49 changes: 49 additions & 0 deletions src/components/moleculesComponents/ASAPBasicComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Text from 'components/atomComponents/Text';
import styled from 'styled-components';
import { theme } from 'styles/theme';
/**
* 이미지, 메인텍스트, 서브텍스트로 이루어진 재사용 컴포넌트
* @returns asap 페이지에 기본이 되는 컴포넌트
* @param {imgURL} : ㅑㅡㅁㅎㄷ
* @param {mainText}
* @param {subText}
*/
interface ASAPBasicComponent {
imgURL: string;
mainText: string;
subText: string;
}

const ASAPBasicComponent = ({ imgURL, mainText, subText }: ASAPBasicComponent) => {
return (
<>
<ImageSection src={imgURL} />
<TextWrapper>
<Text font={'head1'} color={`${theme.colors.white}`}>
{mainText}
</Text>
<Text font={'body1'} color={`${theme.colors.grey4}`}>
{subText}
</Text>
</TextWrapper>
</>
);
};

export default ASAPBasicComponent;

const ImageSection = styled.img`
margin-top: 10.7rem;

width: 21.3rem;
height: 19.9rem;
`;

const TextWrapper = styled.div`
display: flex;
flex-direction: column;
gap: 2.5rem;
align-items: center;
justify-content: center;
margin-top: 2.5rem;
`;
33 changes: 26 additions & 7 deletions src/components/moleculesComponents/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Dispatch, SetStateAction, useState } from 'react';

import Text from 'components/atomComponents/Text';
import Tooltip from 'components/atomComponents/Tooltip';
import { BackIc, ExitIc, HambergerIc, LinkIc, MainLogoIc } from 'components/Icon/icon';
import { useScheduleStepContext } from 'pages/selectSchedule/contexts/useScheduleStepContext';
import { ScheduleStepType } from 'pages/selectSchedule/types';
Expand All @@ -9,11 +10,10 @@ import { useParams } from 'react-router';
import { useNavigate } from 'react-router-dom';
import styled from 'styled-components/macro';
import { theme } from 'styles/theme';
import { notify } from 'utils/toast/copyLink';
import { notify } from 'utils/toast/copyLinkToast';

import Navigation from './Navigation';


interface HeaderProps {
position: string;
setFunnelStep?: Dispatch<SetStateAction<number>>;
Expand All @@ -22,6 +22,7 @@ interface HeaderProps {

function Header({ position, setFunnelStep }: HeaderProps) {
const { scheduleStep, setScheduleStep } = useScheduleStepContext();

const navigationOptions = [
{
title: '약속 생성하기',
Expand Down Expand Up @@ -79,11 +80,7 @@ function Header({ position, setFunnelStep }: HeaderProps) {
<IconSection onClick={() => window.history.back()}>
<BackIc />
</IconSection>
<CopyToClipboard text={`${import.meta.env.VITE_WEB_IP}/meet/${meetingId}`}>
<IconSection onClick={notify}>
<LinkIc />
</IconSection>
</CopyToClipboard>

</ConfirmIconSection>
) : position === 'schedule' ? (
<ConfirmIconSection onClick={backToSelectSchedule}>
Expand All @@ -107,9 +104,22 @@ function Header({ position, setFunnelStep }: HeaderProps) {
) : (
<EmptyBox />
)}
<IconWrapper>
{(position==="completeCreateMeeting" || position==="cueCard" || position==="confirmMeet") &&
<LinkIcWrapper>
<IconSection onClick={notify}>
<CopyToClipboard text={ position==="cueCard" ? `${import.meta.env.VITE_WEB_IP}/q-card/${meetingId}`:`${import.meta.env.VITE_WEB_IP}/meet/${meetingId}` }>
<LinkIc/>
</CopyToClipboard>
</IconSection>
{position==="completeCreateMeeting" && <Tooltip tooltipText={"링크 공유하기"}></Tooltip>}

</LinkIcWrapper>}
<IconSection onClick={() => setIsNaviOpen((prev) => !prev)}>
<HambergerIc />
</IconSection>

</IconWrapper>
</HeaderSection>
{isNaviOpen ? (
<NavigationSection>
Expand All @@ -128,6 +138,14 @@ function Header({ position, setFunnelStep }: HeaderProps) {

export default Header;

const LinkIcWrapper=styled.div`
position:relative;
`

const IconWrapper= styled.div`
display:flex;
align-items: center;
`
const HeaderWrapper = styled.div`
width: 100%;
`;
Expand All @@ -153,6 +171,7 @@ const IconSection = styled.button`
display: flex;
align-items: center;
justify-content: center;
width:4.2rem;
height: 4.2rem;
`;

Expand Down
Loading
Loading