Skip to content

Commit

Permalink
Merge pull request #47 from kendallroth/46-day-details-always-show-co…
Browse files Browse the repository at this point in the history
…untdown

#46 Day Details always show countdown
  • Loading branch information
kendallroth committed Mar 10, 2023
2 parents 2c6b9d3 + 83b4bfb commit 07ac33a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.2] - 2023-03-10

### Fixed
- Day Details always showed countdown state

## [0.4.1] - 2023-03-10

### Added
Expand Down
6 changes: 3 additions & 3 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ const lightenedPrimaryColor = "#00629E";
* Android - 'versionName'
* iOS - 'CFBundleShortVersionString'
*/
const versionName = "0.4.1";
const versionName = "0.4.2";
/**
* Android build code (must increment with each submitted build)
*/
const androidVersionCode = 6;
const androidVersionCode = 7;
/**
* iOS semantic build code (increment with each submitted build)
*
* NOTE: Different from Android version code in that it may be reset
* with each version change; however, this is deemed confusing!
*/
const iosBuildNumber = 6;
const iosBuildNumber = 7;

/**
* Runtime version associated with build manifest, used when applying OTA updates.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "my-days",
"description": "Simple mobile app to track time to/from an important date.",
"version": "0.4.1",
"version": "0.4.2",
"main": "index.js",
"keywords": [
"app",
Expand Down
19 changes: 14 additions & 5 deletions src/screens/Details/DayStat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@ import { Text } from "react-native-paper";
interface DayStatProps {
colorHighlight: string;
colorNormal: string;
countDirection: "up" | "down";
highlighted?: boolean;
number: number | string;
style?: StyleProp<ViewStyle>;
today?: boolean;
unitLabel: string;
value: string;
}

const DayStat = (props: DayStatProps) => {
const { colorHighlight, colorNormal, highlighted, number, style, today, unitLabel } = props;
const {
colorHighlight,
colorNormal,
countDirection,
highlighted,
style,
today,
unitLabel,
value,
} = props;

const textColor = highlighted ? colorHighlight : colorNormal;
const countdown = number >= 0;

return (
<View style={[styles.dayStat, style]}>
Expand All @@ -34,12 +43,12 @@ const DayStat = (props: DayStatProps) => {
]}
variant={highlighted ? "displayLarge" : "displayMedium"}
>
{number}
{value}
</Text>
{highlighted && !today && (
<Icon
color={colorNormal}
name={countdown ? "arrow-down" : "arrow-up"}
name={countDirection === "down" ? "arrow-down" : "arrow-up"}
size={40}
style={styles.dayStatDirectionIcon}
/>
Expand Down
11 changes: 6 additions & 5 deletions src/screens/Details/DetailsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,17 @@ const DetailScreen = () => {
key={stat.unit}
colorHighlight={mainColorText}
colorNormal={mainColorContainer}
number={t("common:format.number", {
countDirection={dateCount.direction}
highlighted={stat.unit === selectedDay.unit}
style={idx > 0 ? { marginTop: pagePadding / 1.5 } : undefined}
today={dateCount.today}
unitLabel={stat.unitLabel}
value={t("common:format.number", {
value: stat.number,
signDisplay: "never",
maximumFractionDigits: decimals,
minimumFractionDigits: decimals,
})}
unitLabel={stat.unitLabel}
highlighted={stat.unit === selectedDay.unit}
today={dateCount.today}
style={idx > 0 ? { marginTop: pagePadding / 1.5 } : undefined}
/>
);
})}
Expand Down

0 comments on commit 07ac33a

Please sign in to comment.