theme-ui#Progress JavaScript Examples

The following examples show how to use theme-ui#Progress. 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: VideoUploadForm.js    From Easy-Annotator with GNU General Public License v3.0 4 votes vote down vote up
render() {
    const { uploading } = this.state;

    return (
      <Box
        as="form"
        onSubmit={e => e.preventDefault()}
        py={3}
        action="/upload"
        method="post"
        encType="multipart/form-data"
      >
        {!uploading ? (
          <Flex pl={2}>
            <Box
              sx={{
                color: "primary",
                border: 2,
                borderRadius: 4,
                borderStyle: "dashed",
                position: "relative",
                "&:hover": {
                  color: "highlight"
                }
              }}
              width={8 / 20}
              mx={2}
            >
              <Input
                sx={{
                  position: "absolute",
                  margin: "0",
                  padding: "0",
                  width: "100%",
                  height: "100%",
                  outline: "none",
                  opacity: "0",
                  cursor: "pointer"
                }}
                type="file"
                name="video"
                onChange={this.onChangeHandler}
              />
              <Text
                sx={{
                  color: "text",
                  textAlign: "center",
                  fontWeight: "100",
                  textTransform: "lowercase",
                  padding: "7px 0"
                }}
              >
                {this.state.selectedFileCheck
                  ? this.state.fileName
                  : "upload video"}
              </Text>
            </Box>
            <Input
              id="deviceType"
              name="deviceType"
              placeholder="device type"
              value={this.deviceValue}
              onChange={this.handleDeviceValueChange}
              width={8 / 20}
              mx={2}
            />
            <Button
              width={5 / 20}
              mx={2}
              type="submit"
              id="submit"
              name="submit"
              onClick={this.onClickHandler}
              sx={{
                color: "background",
                "&:hover": {
                  bg: "highlight",
                  border: 0
                }
              }}
            >
              upload
            </Button>
          </Flex>
        ) : (
          <Flex>
            <Progress
              width={8 / 10}
              sx={{ mx: 2 }}
              max={100}
              value={this.state.uploadedProgress}
            />
          </Flex>
        )}
      </Box>
    );
  }