Skip to content

Commit

Permalink
🚀 Release 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt committed Jan 15, 2020
2 parents 23453a1 + 8ae7008 commit 500df39
Show file tree
Hide file tree
Showing 77 changed files with 1,257 additions and 364 deletions.
6 changes: 4 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# import { API_URL } from 'react-native-dotenv'

# Same as MARKETING_VERSION in iOS / version in Android
APP_MARKETING_VERSION=0.12.4
APP_MARKETING_VERSION=0.13.0

# Same as CURRENT_PROJECT_VERSION in iOS / version code in Android
APP_VERSION=148
APP_VERSION=155

# APP_VERSION must be greater or equal to the this value
# without forcing user to update the app
Expand All @@ -32,3 +32,5 @@ IAP_IOS_IS_SANDBOX=
IAP_IOS_SHARED_SECRET=

SENTRY_DSN=

USER_PII_SALT=
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ android {
applicationId "com.oice"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 148
versionName "0.12.4"
versionCode 155
versionName "0.13.0"
missingDimensionStrategy 'react-native-camera', 'general'
}
splits {
Expand Down
3 changes: 3 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**

# react-native-keychain
-keep class com.facebook.crypto.** { *; }

# react-native-config
-keep class com.mypackage.BuildConfig { *; }

Expand Down
5 changes: 2 additions & 3 deletions app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { BackButtonHandler } from "./navigation/back-button-handler"
import { DEFAULT_NAVIGATION_CONFIG } from "./navigation/navigation-config"
import { RootStore, setupRootStore } from "./models/root-store"
import { logError } from "./utils/error"
import { Screen } from "./components/screen"
import { color } from "./theme"
import { LoadingScreen } from "./components/loading-screen"
import { StorybookUIRoot } from "../storybook"

/**
Expand Down Expand Up @@ -117,7 +116,7 @@ export class App extends React.Component<{}, AppState> {
// You're welcome to swap in your own component to render if your boot up
// sequence is too slow though.
if (!rootStore || this.state.rootStore.isDeprecatedAppVersion) {
return <Screen backgroundColor={color.primary} />
return <LoadingScreen />
}

// otherwise, we're ready to render the app
Expand Down
23 changes: 23 additions & 0 deletions app/components/avatar/avatar.props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ViewStyle } from "react-native"

export interface AvatarProps {
/**
* The URL of the avatar
*/
src: string

/**
* The size of the avatar. Default is `64` pt.
*/
size?: number

/**
* Set to `true` to display the Civic Liker halo. Default is `false`
*/
isCivicLiker?: boolean

/**
* An optional style override useful for padding & margin.
*/
style?: ViewStyle
}
27 changes: 27 additions & 0 deletions app/components/avatar/avatar.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
ImageStyle,
StyleSheet,
ViewStyle,
} from "react-native"
import { color, spacing } from "../../theme"

export const AvatarStyle = StyleSheet.create({
Gradient: {
borderWidth: spacing[1],
borderColor: color.transparent,
margin: spacing[1],
} as ViewStyle,
Halo: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
} as ViewStyle,
Image: {
overflow: "hidden",
} as ImageStyle,
Root: {
position: "relative",
} as ViewStyle,
})
68 changes: 68 additions & 0 deletions app/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import * as React from "react"
import { View, ViewStyle, Image, ImageStyle, StyleSheet } from "react-native"
import LinearGradient from "react-native-linear-gradient"

import { AvatarProps as Props } from "./avatar.props"
import { AvatarStyle as Style } from "./avatar.style"
import CivicLikerHalo from "./civic-liker-halo.svg"

import { gradient } from "../../theme"

/**
* Avatar for Liker
*/
function AvatarComponent(props: Props) {
const { src, size, isCivicLiker, style, ...rest } = props

const rootStyle = React.useMemo(
() => [Style.Root, style],
[style]
)

const imageStyle = React.useMemo(
() => StyleSheet.flatten([
Style.Image,
{
width: size,
height: size,
borderRadius: size / 2,
} as ImageStyle
]),
[size]
)

const gradientStyle = React.useMemo(
() => [
Style.Gradient,
{
borderRadius: imageStyle.borderRadius + Style.Gradient.borderWidth,
} as ViewStyle,
],
[size]
)

return (
<View style={rootStyle} {...rest}>
<LinearGradient
colors={gradient.LikeCoin}
start={{ x: 0.0, y: 1.0 }}
end={{ x: 1.0, y: 0.0 }}
style={gradientStyle}
>
<Image
style={imageStyle}
source={{ uri: src }}
/>
</LinearGradient>
{isCivicLiker && <CivicLikerHalo style={Style.Halo} />}
</View>
)
}

AvatarComponent.displayName = "Avatar"

AvatarComponent.defaultProps = {
size: 64,
} as Partial<Props>

export const Avatar = React.memo(AvatarComponent)
4 changes: 4 additions & 0 deletions app/components/avatar/civic-liker-halo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/components/avatar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./avatar"
5 changes: 5 additions & 0 deletions app/components/content-list-item/bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion app/components/content-list-item/content-list-item.props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { Content } from "../../models/content"
export interface ContentListItemProps {
content: Content

/**
* Set to false to hide the bookmark icon. Default is true.
*/
isShowBookmarkIcon?: boolean

/**
* An optional style override useful for padding & margin.
*/
Expand All @@ -13,5 +18,10 @@ export interface ContentListItemProps {
/**
* A callback when the item is pressed.
*/
onPress?: Function
onPress?: (url: string) => void

/**
* A callback when the bookmark button is pressed.
*/
onBookmark?: (url: string) => void
}
16 changes: 16 additions & 0 deletions app/components/content-list-item/content-list-item.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ import { spacing } from "../../theme"

export default {
ROOT: {
position: "relative",
paddingVertical: spacing[4],
paddingHorizontal: spacing[5],
} as ViewStyle,
ROW: {
flexDirection: "row",
alignItems: "center",
} as ViewStyle,
FOOTER: {
marginTop: spacing[2],
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
} as ViewStyle,
DETAIL_VIEW: {
flex: 1,
} as ViewStyle,
Expand All @@ -30,4 +37,13 @@ export default {
aspectRatio: 1,
resizeMode: "cover",
} as ImageStyle,
BOOKMARK_FLAG: {
position: "absolute",
top: -spacing[1],
right: spacing[0],
width: 32,
height: 32,
alignItems: "flex-end",
justifyContent: "flex-start",
} as ViewStyle,
}
Loading

0 comments on commit 500df39

Please sign in to comment.