react-icons/fi#FiShare JavaScript Examples

The following examples show how to use react-icons/fi#FiShare. 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: Subject.js    From airdnd-frontend with MIT License 5 votes vote down vote up
Subject = ({ isLoading, home }) => {
  const { isLoggedIn } = useSelector(state => state.user);
  const dispatch = useDispatch();

  const onClickBookmark = () => toggleBookmark(isLoggedIn, home, dispatch);
  const isBookmarked = home && home.isBookmarked;
  console.log(isBookmarked, typeof isBookmarked);

  return (
    <StDetailTitle>
      <StH2 isLoading={isLoading}>{home && home.title}</StH2>
      <StLinkWrapper isLoading={isLoading}>
        {!isLoading && (
          <>
            <Rating
              scale="1.4"
              rate={home.reviews.rating}
              count={home.reviews.count}
            />
            {home.host.isSupperhost && (
              <>
                <StDot>·</StDot>
                <StSuperHost>
                  <FaCrown style={{ color: '#FF385C' }} />
                  <span>슈퍼호스트</span>
                </StSuperHost>
              </>
            )}
            <StDot>·</StDot>
            <StLocationLink>{home.address}</StLocationLink>
            <StButton transition>
              <FiShare />
              공유하기
            </StButton>
            <StButton transition onClick={onClickBookmark}>
              <StHeart
                size="smaller"
                bgColor={isBookmarked ? 'main' : 'white'}
                stroke={isBookmarked ? 'main' : 'black'}
              />
              저장
            </StButton>
          </>
        )}
      </StLinkWrapper>
      <HomePhotos isLoading={isLoading} home={home} />
    </StDetailTitle>
  );
}
Example #2
Source File: SelectionBar.js    From winstall with GNU General Public License v3.0 5 votes vote down vote up
function SelectionBar({ router }) {
    const { selectedApps, setSelectedApps } = useContext(SelectedContext);
    const [ hideCreatePack, setHideCreatePack ] = useState(false);

    useEffect(() => {
      if(router.pathname === "/packs/create"){
        setHideCreatePack(true);
      } else{
        setHideCreatePack(false);
      };
    }, [ router ])

    if(selectedApps.length === 0) return <></>;

    let handleClear = () => {
      // check if confirm exists
      // support for iOS safari
      if ('confirm' in window && typeof window.confirm === 'function'){
        if(window.confirm("Are you sure you want to unselect all the apps?")){
            setSelectedApps([]);
        }
      } else{
        setSelectedApps([]);
      }
    }
    return (
      <div className="bottomBar">
        <div className="container inner">
          <div className="appPreview">
            <p>Selected {selectedApps.length} apps so far</p>
          </div>
          <div className="controls">
            <button className="clear small" onClick={() => handleClear()} title="Clear selections">
              <FiTrash />
            </button>
            { !hideCreatePack && (
              <Link href="/packs/create">
                <button disabled={selectedApps.length >= 5 ? false : true}>
                  <FiShare />
                  <em>{selectedApps.length >= 5 ? "Create Pack" : `Need ${Math.abs(5 - selectedApps.length)} more ${Math.abs(5 - selectedApps.length) === 1 ? "app" : "apps"} to create a pack.`}</em>
                </button>
              </Link>
            )}
            <Link href="/generate">
              <button>
                <FiCodepen />
                Generate script
              </button>
            </Link>
          </div>
        </div>
      </div>
    );
}