Skip to content

Commit

Permalink
chore: fixs types
Browse files Browse the repository at this point in the history
  • Loading branch information
OverGlass committed Nov 13, 2023
1 parent 3cc70dd commit 66d65e3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
15 changes: 8 additions & 7 deletions src/screens/eventDetail/EventDetailsContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useWindowDimensions,
View,
} from "react-native";
import HTML from "react-native-render-html";
import HTML, { MixedStyleDeclaration } from "react-native-render-html";
import { DetailedEvent } from "../../core/entities/Event";
import { Colors, Spacing, Styles, Typography } from "../../styles";
import i18n from "../../utils/i18n";
Expand Down Expand Up @@ -121,11 +121,11 @@ export const EventDetailsContent: FC<Props> = ({ detailedEvent, onReloadEvent })
<View style={styles.separator} />
<Text style={styles.subtitle}>{i18n.t("eventdetails.description")}</Text>
<HTML
containerStyle={styles.htmlContainer}
baseStyle={rootStyles}
source={{
html: viewModel.description,
}}
tagsStyles={{ p: paragraphStyle }}
tagsStyles={{ p: paragraphStyle as MixedStyleDeclaration }}
contentWidth={contentWidth}
/>
{viewModel.canSeeMore ? (
Expand Down Expand Up @@ -161,6 +161,11 @@ const paragraphStyle: TextStyle = {
marginBottom: Spacing.unit,
};

const rootStyles = {
marginHorizontal: Spacing.margin,
marginTop: Spacing.unit,
};

const styles = StyleSheet.create({
attendees: {
...Typography.body,
Expand Down Expand Up @@ -188,10 +193,6 @@ const styles = StyleSheet.create({
eventItemsContainer: {
flex: 1,
},
htmlContainer: {
marginHorizontal: Spacing.margin,
marginTop: Spacing.unit,
},
image: {
height: 203,
},
Expand Down
3 changes: 3 additions & 0 deletions src/screens/home/quickPoll/HomeQuickPollResultView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ const HomeQuickPollResultView: FunctionComponent<Props> = ({ viewModel }) => {
<View
style={[
styles.progress,
// TODO: use flex instead of strin percentage
//@ts-ignore
{
backgroundColor: Colors.quickPollProgress,
width: viewModel.leadingAnswerViewModel.percentage + "%",
// flex: parseInt(viewModel.leadingAnswerViewModel.formattedPercentage, 10) / 100,
},
]}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/personalInformation/GenderPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const GenderPicker: FC<Props> = (props) => {
useNativeAndroidPickerStyle={false}
placeholder={{}}
value={props.defaultValue}
Icon={() => <View style={styles.icon} />}
Icon={<View style={styles.icon} />}
onValueChange={props.onValueChange}
items={[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class CompoundPollDetailComponentProvider<A, B>
return { provider: this.lhs, relativeStep: step };
} else {
return {
// TODO: fix type
// @ts-ignore
provider: this.rhs,
relativeStep: step - this.lhs.getNumberOfSteps(),
};
Expand Down
6 changes: 2 additions & 4 deletions src/screens/shared/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ type IconProps = Readonly<{
type BaseButtonProps = Readonly<{
backgroundColor: string;
textColor: string;
children: React.ComponentProps<typeof TouchablePlatform>["children"];
children?: React.ComponentProps<typeof TouchablePlatform>["children"];
}>;

const BaseButton: FunctionComponent<
ButtonProps & BaseButtonProps & IconProps & { children: any }
> = (props) => {
const BaseButton: FunctionComponent<ButtonProps & BaseButtonProps & IconProps> = (props) => {
const opacity = props.disabled ? 0.5 : 1.0;
const defaultBackground = props.backgroundColor;
const disabledBackground = ColorUtils.lighten(defaultBackground, 0.7);
Expand Down

0 comments on commit 66d65e3

Please sign in to comment.