Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/weareteamturing/bombe in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
psch300 committed Aug 29, 2024
2 parents fb20439 + 1921d50 commit 3d06706
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { StyleProp, ViewStyle } from 'react-native';
import type { StyleProp, ViewStyle, ImageSourcePropType } from 'react-native';
import { View } from 'react-native';

import { is, appendImageSizeQueryParams } from '../../util';
import { Img } from '../Img';

import defaultImage from './profile_outline_gray_90.png';
import DEFAULT_PROFILE_IMAGE from './profile_outline_gray_90.png';

// this is used for just rendering character image in light component like list item(shouldn't be heavy)
const LightProfilePhoto = ({
Expand All @@ -14,13 +14,15 @@ const LightProfilePhoto = ({
borderColor,
borderWidth = 0,
optimize = true,
defaultImage = DEFAULT_PROFILE_IMAGE,
}: {
profileImageUrl: string;
style?: StyleProp<Omit<ViewStyle, 'borderWidth' | 'borderColor'>>;
size?: number;
borderWidth?: number;
borderColor?: string;
optimize?: boolean;
defaultImage?: ImageSourcePropType;
}) => {
const size = _size || 56;
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ReactElement } from 'react';
import { type StyleProp, type ViewStyle, View } from 'react-native';
import { type StyleProp, type ViewStyle, View, type ImageSourcePropType } from 'react-native';

import { palette } from '../../theme';
import { is } from '../../util';
Expand All @@ -18,6 +18,7 @@ type Props = {
length?: number;
testID?: string;
profileImageUrl?: string;
defaultImage?: ImageSourcePropType;
};
const ProfilePhoto = ({
style,
Expand All @@ -27,6 +28,7 @@ const ProfilePhoto = ({
length: _length,
testID,
profileImageUrl,
defaultImage,
}: Props): ReactElement => {
const length = is.number(_length) ? _length : defaultLength;

Expand All @@ -52,7 +54,7 @@ const ProfilePhoto = ({
onPress={onPress}
disabled={!pressable}
>
<LightProfilePhoto profileImageUrl={profileImageUrl || ''} size={length} />
<LightProfilePhoto profileImageUrl={profileImageUrl || ''} size={length} defaultImage={defaultImage} />
{showIcon ? (
<View
style={{
Expand Down

0 comments on commit 3d06706

Please sign in to comment.