@fortawesome/free-solid-svg-icons#faPowerOff TypeScript Examples

The following examples show how to use @fortawesome/free-solid-svg-icons#faPowerOff. 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: core.module.ts    From enterprise-ng-2020-workshop with MIT License 6 votes vote down vote up
constructor(
    @Optional()
    @SkipSelf()
    parentModule: CoreModule,
    faIconLibrary: FaIconLibrary
  ) {
    if (parentModule) {
      throw new Error('CoreModule is already loaded. Import only in AppModule');
    }
    faIconLibrary.addIcons(
      faCog,
      faBars,
      faRocket,
      faPowerOff,
      faUserCircle,
      faPlayCircle,
      faGithub,
      faMediumM,
      faTwitter,
      faInstagram,
      faYoutube
    );
  }
Example #2
Source File: EndMeetingControl.tsx    From amazon-chime-sdk-smart-video-sending-demo with Apache License 2.0 5 votes vote down vote up
EndMeetingControl: React.FC = () => {
  const meetingManager = useMeetingManager();
  const history = useHistory();
  const [showEndModal, setShowEndModal] = useState(false);
  const { updateMeetingStatus } = useMeetingStatus();
  const messagingService = useVideoSendingService();

  const toggleEndMeeting = (): void => {
    setShowEndModal(!showEndModal);
  }

  const closeWS = () => {
    try {
      messagingService?.websocket?.close(DEFAULT_WEB_SOCKET_TIMEOUT_MS);
      console.log('Closing web socket');
    } catch (error) {
      console.error(`Unable to send close message on messaging socket: ${error}`);
    }
  }

  const endMeeting = async (): Promise<void> => {
    await meetingManager?.endMeeting();
    updateMeetingStatus(MeetingStatus.Ended);
    closeWS();
    history.push(routes.HOME);
  }

  const leaveMeeting = async (): Promise<void> => {
    await meetingManager?.leaveMeeting();
    closeWS();
    history.push(routes.HOME);
  }

  return (
    <>
      <ButtonGroup>
        <IconButton icon={faSignOutAlt} onClick={leaveMeeting} />
        <IconButton icon={faPowerOff} onClick={toggleEndMeeting} />
      </ButtonGroup>
      {showEndModal && (
        <Modal size="medium" onClose={toggleEndMeeting} rootId="modal-root">
        <ModalHeader title="End Meeting" />
        <ModalBody>
          <StyledP>
            Are you sure you want to end the meeting for everyone? The meeting
            cannot be used after ending it.
          </StyledP>
        </ModalBody>
        <ModalButtonGroup
          primaryButtons={[
            <ModalButton
              onClick={endMeeting}
              variant="primary"
              label="End meeting for all"
              closesModal
            />,
            <ModalButton variant="secondary" label="Cancel" closesModal />
          ]}
        />
      </Modal>
      )}
    </>
  );
}