vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG
MIT License
692 stars 87 forks source link

Timer display gets cut in half when used as a Header. #244

Closed Bellarose143 closed 6 months ago

Bellarose143 commented 7 months ago

When passing the timer into headerTitle the timer gets cutoff almost every time, but not always. Below is the snippet where I added the component to the header:

headerTitle: () =>
        questList != undefined ? (
          <SafeAreaView>
            <CountdownCircleTimer
              style={{ top: 0 }}
              isPlaying={!quizDone}
              duration={time}
              colors={"black"}
              onComplete={() => {
                setQuizDone(true);
                return { shouldRepeat: false, delay: 0.5 };
              }}
              updateInterval={1}
              size={80}
              strokeWidth={5}
              children={({ remainingTime }) => {
                return (
                  <Text
                    style={{
                      fontFamily: "ReemKufi-Bold",
                      color: "black",
                      fontSize: 24,
                    }}
                  >
                    {`${Math.floor(remainingTime / 60)}:${
                      remainingTime % 60 < 10
                        ? "0" + (remainingTime % 60)
                        : remainingTime % 60
                    }`}
                  </Text>
                );
              }}
            ></CountdownCircleTimer>
          </SafeAreaView>
        ) : (
          <></>
        ),
    }

Here is an example of what that looks like: image

vydimitrov commented 6 months ago

It does not seem released to the timer but rather layout position of the elements on the page.