@material-ui/icons#GetApp TypeScript Examples

The following examples show how to use @material-ui/icons#GetApp. 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: Content.tsx    From signer with Apache License 2.0 6 votes vote down vote up
export function ContentPageTwo({ accountManager }: ContentPageTwoProps) {
  return (
    <List>
      {accountManager &&
        accountManager.userAccounts &&
        accountManager.userAccounts.map((account, index) => (
          <ListItem>
            <ListItemText primary={account.alias} />
            <ListItemSecondaryAction>
              <Tooltip title="Download">
                <IconButton
                  edge="end"
                  onClick={() => {
                    accountManager.downloadPemFiles(account.alias);
                  }}
                >
                  <GetApp />
                </IconButton>
              </Tooltip>
            </ListItemSecondaryAction>
          </ListItem>
        ))}
    </List>
  );
}
Example #2
Source File: AccountManagementPage.tsx    From signer with Apache License 2.0 4 votes vote down vote up
render() {
    return !this.props.accountManager.isUnLocked ||
      !this.props.accountManager.userAccounts[0] ? (
      <Redirect to={Pages.Home} />
    ) : (
      <React.Fragment>
        <DragDropContext onDragEnd={result => this.onDragEnd(result)}>
          <Droppable droppableId="droppable">
            {(provided, snapshot) => (
              <Observer>
                {() => (
                  // TODO: fix this (deprecated RootRef)
                  <RootRef rootRef={provided.innerRef}>
                    <List>
                      {this.props.accountManager.userAccounts.map(
                        (item, index) => (
                          <Draggable
                            key={item.alias}
                            draggableId={item.alias}
                            index={index}
                          >
                            {(provided, snapshot) => (
                              <ListItem
                                innerRef={provided.innerRef}
                                ContainerProps={{
                                  ...provided.draggableProps,
                                  ...provided.dragHandleProps,
                                  style: getItemStyle(
                                    snapshot.isDragging,
                                    provided.draggableProps.style
                                  )
                                }}
                              >
                                <ListItemText primary={item.alias} />
                                <ListItemSecondaryAction>
                                  <Tooltip title="Edit">
                                    <IconButton
                                      aria-label="Button will open a dialog to rename key"
                                      edge={'end'}
                                      onClick={() => {
                                        this.handleClickOpen(item);
                                      }}
                                    >
                                      <EditIcon />
                                    </IconButton>
                                  </Tooltip>
                                  <Tooltip title="Delete">
                                    <IconButton
                                      edge={'end'}
                                      onClick={() => {
                                        this.handleClickRemove(item.alias);
                                      }}
                                    >
                                      <DeleteIcon />
                                    </IconButton>
                                  </Tooltip>
                                  <Tooltip title="View">
                                    <IconButton
                                      edge={'end'}
                                      onClick={() => {
                                        this.handleViewKey(item.alias);
                                      }}
                                    >
                                      <VpnKeyIcon />
                                    </IconButton>
                                  </Tooltip>
                                  <Tooltip title="Download">
                                    <IconButton
                                      edge={'end'}
                                      onClick={() => {
                                        this.handleDownloadKeys(item.alias);
                                      }}
                                    >
                                      <GetApp />
                                    </IconButton>
                                  </Tooltip>
                                </ListItemSecondaryAction>
                              </ListItem>
                            )}
                          </Draggable>
                        )
                      )}
                      {provided.placeholder}
                    </List>
                  </RootRef>
                )}
              </Observer>
            )}
          </Droppable>
        </DragDropContext>
        <Dialog
          open={this.state.openDialog}
          onClose={this.handleClose}
          aria-label="Form to rename account - focus will be given to name input field"
          aria-labelledby="form-dialog-title"
        >
          <form>
            <DialogTitle id="form-dialog-title">Rename</DialogTitle>
            <DialogContent>
              <TextFieldWithFormState
                autoFocus
                fullWidth
                label="Rename account"
                placeholder="Account alias"
                id="rename-account"
                fieldState={this.renameAccountForm.name}
              />
            </DialogContent>
            <DialogActions>
              <Button onClick={this.handleClose} color="primary">
                Cancel
              </Button>
              <Button
                type="submit"
                onClick={this.handleUpdateName}
                color="primary"
                disabled={this.renameAccountForm.submitDisabled}
              >
                Update
              </Button>
            </DialogActions>
          </form>
        </Dialog>

        <Dialog
          fullScreen
          open={this.state.openKeyDialog}
          onClose={this.handleClose}
          aria-labelledby="form-dialog-title"
        >
          <DialogTitle id="form-dialog-title">Account Details</DialogTitle>
          <DialogContent>
            <List>
              <ListSubheader>
                <Typography variant={'h6'}>{this.state.alias}</Typography>
              </ListSubheader>
              <ListItem>
                <IconButton
                  edge={'start'}
                  onClick={() => {
                    copy(this.state.publicKeyHex!);
                    this.setState({ copyStatus: true });
                  }}
                >
                  <FilterNoneIcon />
                </IconButton>
                <ListItemText
                  primary={`Public Key: ${this.state.publicKeyHex}`}
                  style={{ overflowWrap: 'break-word' }}
                />
              </ListItem>
              <ListItem>
                <IconButton
                  edge={'start'}
                  onClick={() => {
                    copy(this.state.accountHash!);
                    this.setState({ copyStatus: true });
                  }}
                >
                  <FilterNoneIcon />
                </IconButton>
                <ListItemText
                  primary={`Account Hash: ${this.state.accountHash}`}
                  style={{ overflowWrap: 'break-word' }}
                />
              </ListItem>
            </List>
            <Snackbar
              open={this.state.copyStatus}
              message="Copied!"
              autoHideDuration={1500}
              onClose={this.handleCopyMessage}
            />
          </DialogContent>
          <DialogActions>
            <Button onClick={this.handleClose} color="primary">
              Close
            </Button>
          </DialogActions>
        </Dialog>
      </React.Fragment>
    );
  }