react-icons/go#GoPlus JavaScript Examples
The following examples show how to use
react-icons/go#GoPlus.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DetailGuestPopup.js From airdnd-frontend with MIT License | 4 votes |
DetailGuestPopup = ({
adult,
child,
infant,
popup,
onOpenPopup,
popupState,
onClosePopup,
increaseGuestCount,
decreaseGuestCount,
capacity,
isFullCapacity,
displayName,
...rest
}) => {
return (
<StGuests tabIndex="0" ref={popup} onClick={onOpenPopup} {...rest}>
{displayName && <StName>인원</StName>}
<StContent>
게스트 {adult + child > 0 ? adult + child : 0}명
{!!infant && infant > 0 && `, 유아 ${infant}명`}
</StContent>
<StPopup popupState={popupState} top="57px" left="-2px">
<ul>
<StCountGuest>
<div>성인</div>
<StCountBtn
dimmed={adult <= 1}
btnType="circle"
onClick={() => decreaseGuestCount('adult')}
>
<GoDash />
</StCountBtn>
<div>{adult}</div>
<StCountBtn
dimmed={isFullCapacity}
btnType="circle"
onClick={() => increaseGuestCount('adult')}
>
<GoPlus />
</StCountBtn>
</StCountGuest>
<StCountGuest>
<div>
어린이<div>2~12세</div>
</div>
<StCountBtn
dimmed={!child}
btnType="circle"
onClick={() => decreaseGuestCount('child')}
>
<GoDash />
</StCountBtn>
<div>{child}</div>
<StCountBtn
dimmed={isFullCapacity}
btnType="circle"
onClick={() => increaseGuestCount('child')}
>
<GoPlus />
</StCountBtn>
</StCountGuest>
<StCountGuest>
<div>
유아<div>2세 미만</div>
</div>
<StCountBtn
dimmed={!infant}
btnType="circle"
onClick={() => decreaseGuestCount('infant')}
>
<GoDash />
</StCountBtn>
<div>{infant}</div>
<StCountBtn
dimmed={infant >= 5}
btnType="circle"
onClick={() => increaseGuestCount('infant')}
>
<GoPlus />
</StCountBtn>
</StCountGuest>
</ul>
<StCapacityMsg>
최대 {capacity}명. 유아는 숙박인원에 포함되지 않습니다.
</StCapacityMsg>
<StCloseBtn
btnType="underlined"
fontWeight="600"
onClick={onClosePopup}
>
닫기
</StCloseBtn>
</StPopup>
</StGuests>
);
}
Example #2
Source File: Activities.js From gitpedia with MIT License | 4 votes |
Activities = ({ activityData }) => {
const extractActivity = () => {
const message = activityData.map((activity) => {
let icon = "";
let action = "";
let actionPerformed; // For Pull req
let repoName = activity.repo.name;
let time = new Date(activity.created_at)
.toDateString()
.split(" ")
.slice(1)
.join(" ");
switch (activity.type) {
case "CommitCommentEvent":
break;
case "CreateEvent":
if (activity.payload.ref_type === "branch") {
icon = <GoGitBranch />;
action = `Created a branch ${activity.payload.ref} in `;
} else {
icon = <GoPlus />;
action = `Created a ${activity.payload.ref_type} in `;
}
break;
case "DeleteEvent":
icon = <GoTrashcan />;
action = `Deleted a ${activity.payload.ref_type} ${activity.payload.ref} from `;
break;
case "ForkEvent":
icon = <GoRepoForked />;
action = `Forked a repository ${repoName} to `;
repoName = activity.payload.forkee.full_name;
break;
case "IssueCommentEvent":
icon = <GoComment />;
actionPerformed =
activity.payload.action.charAt(0).toUpperCase() +
activity.payload.action.slice(1);
action = `${actionPerformed} a comment on an issue in `;
break;
case "IssuesEvent":
if (activity.payload.action === "closed") {
icon = <GoIssueClosed />;
} else {
icon = <GoIssueOpened />;
}
actionPerformed =
activity.payload.action.charAt(0).toUpperCase() +
activity.payload.action.slice(1);
action = `${actionPerformed} an issue in `;
break;
case "PullRequestEvent":
if (activity.payload.action === "closed") {
icon = <GoTrashcan />;
} else {
icon = <GoRepoPull />;
}
actionPerformed =
activity.payload.action.charAt(0).toUpperCase() +
activity.payload.action.slice(1);
action = `${actionPerformed} a pull request in `;
break;
case "PullRequestReviewCommentEvent":
icon = <GoComment />;
actionPerformed =
activity.payload.action.charAt(0).toUpperCase() +
activity.payload.action.slice(1);
action = `${actionPerformed} a comment on their pull request in `;
break;
case "PushEvent":
icon = <GoRepoPush />;
let commit = "commit";
let branch = activity.payload.ref.slice(11);
if (activity.payload.size > 1) {
commit = "commits";
}
action = `Pushed ${activity.payload.size} ${commit} to ${branch} in `;
break;
case "WatchEvent":
icon = <GoStar />;
action = "Starred the repository ";
break;
case "ReleaseEvent":
icon = <GoBook />;
actionPerformed =
activity.payload.action.charAt(0).toUpperCase() +
activity.payload.action.slice(1);
action = `${actionPerformed} a release in `;
break;
default:
action = "";
}
return { icon, action, repoName, time };
});
return message;
};
const buildActivityList = () => {
const messages = extractActivity();
if (messages.length !== 0) {
return messages.map((message) => (
<li>
<ActivitiesItem>
<ActivityDiv>
<span>
{message.icon} {message.action}
</span>
<a href={`https://github.com/${message.repoName}`}>
{message.repoName}
</a>
</ActivityDiv>
<TimeDiv>{message.time}</TimeDiv>
</ActivitiesItem>
</li>
));
} else {
return (
<li>
<ActivitiesItem>
<FlexContainer>
No recent activities found :(
</FlexContainer>
</ActivitiesItem>
</li>
);
}
};
return (
<>
<ActivitiesContainer>
<ul>{buildActivityList()}</ul>
</ActivitiesContainer>
</>
);
}