Skip to content

Commit

Permalink
Merge branch 'main' into feat/tablet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kgeek33 committed Nov 16, 2024
2 parents f43c819 + c14741e commit 1ba45d6
Show file tree
Hide file tree
Showing 18 changed files with 525 additions and 396 deletions.
378 changes: 134 additions & 244 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
"react-native-draggable-flatlist": "^4.0.1",
"react-native-draglist": "^3.6.1",
"react-native-gesture-handler": "^2.16.1",
"react-native-htmlview": "^0.17.0",
"react-native-infinite-pager": "^0.3.16",
"react-native-pager-view": "6.3.0",
"react-native-parsed-text": "^0.0.22",
"react-native-pressable-scale": "^2.1.0",
"react-native-qrcode-svg": "^6.3.1",
"react-native-reanimated": "~3.10.1",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-svg": "^15.2.0",
Expand All @@ -105,6 +105,7 @@
"@types/html-to-text": "^9.0.4",
"@types/lodash": "^4.17.7",
"@types/react": "~18.2.45",
"@types/react-native-htmlview": "^0.16.5",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^8.57.0",
Expand Down
12 changes: 7 additions & 5 deletions src/components/Global/PapillonPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ const PapillonPicker: React.FC<PapillonPickerProps> = ({
styles.picker,
direction === "left" ? {
left: 0,
transformOrigin: "left top",
} : {
right: 0,
transformOrigin: "left right",
},
{
backgroundColor: Platform.OS === "ios" ? theme.colors.card + 50 : theme.colors.card,
borderColor: theme.colors.text + "35",
borderColor: theme.colors.text + "55",
top: contentHeight + 10,
}
]}
Expand Down Expand Up @@ -190,14 +192,14 @@ const styles = StyleSheet.create({
width: 0,
height: 1,
},
shadowOpacity: 0.25,
shadowRadius: 10,
shadowOpacity: 0.15,
shadowRadius: 6,
elevation: 2,
},
item: {
paddingVertical: 12,
paddingRight: 14,
marginLeft: 14,
paddingRight: 22,
marginLeft: 16,
width: "100%",
flexDirection: "row",
justifyContent: "flex-start",
Expand Down
1 change: 1 addition & 0 deletions src/components/Home/AccountSwitcherContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const ContextMenu: React.FC<{
style={[
{
backgroundColor: colors.card,
transformOrigin: "top left",
},
styles.menu,
]}
Expand Down
4 changes: 0 additions & 4 deletions src/router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ const Router: React.FC = () => {
if (account.personalization?.color?.hex?.primary !== undefined) {
theme.colors.primary = account.personalization.color.hex.primary;
}

if (account.personalization?.color?.hex?.darker !== undefined) {
SystemUI.setBackgroundColorAsync(account.personalization.color.hex.darker);
}
}

return (
Expand Down
2 changes: 2 additions & 0 deletions src/router/screens/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import LessonDocument from "@/views/account/Lessons/Document";
import ScodocWebview from "@/views/login/IdentityProvider/actions/BackgroundIUTLannion";
import ScodocBackgroundWebview from "@/views/login/IdentityProvider/actions/BackgroundIUTLannion";
import BackgroundIUTLannion from "@/views/login/IdentityProvider/actions/BackgroundIUTLannion";
import { Platform } from "react-native";

export default [
createScreen("NoteReaction", NoteReaction, {
Expand Down Expand Up @@ -71,6 +72,7 @@ export default [
createScreen("GradeDocument", GradeDocument, {
headerTitle: "Détail de la note",
presentation: "modal",
headerShown: Platform.OS !== "ios",
}),
createScreen("ChatCreate", ChatCreate, {
headerTitle: "Nouvelle discussion",
Expand Down
14 changes: 5 additions & 9 deletions src/utils/ui/animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const animPapillon = (animation: any) => {
};

const EnteringDuration = 200;
const EnteringScale = 0.8;
const ExitingDuration = 150;
const ExitingScale = 0.9;

// Paramètres d'animation pour l'entrée du menu contextuel
const PapillonAnimSettings = {
Expand All @@ -30,16 +32,12 @@ const PapillonContextEnter = () => {
{
scale: withTiming(1, PapillonAnimSettings),
},
{ translateY: withTiming(0, PapillonAnimSettings) },
{ translateX: withTiming(0, PapillonAnimSettings) },
],
};
const initialValues = {
opacity: 0,
transform: [
{ scale: 0.7 },
{ translateY: -20 },
{ translateX: 0 },
{ scale: EnteringScale },
],
};
return {
Expand All @@ -54,14 +52,12 @@ const PapillonContextExit = () => {
const animations = {
opacity: withTiming(0, PapillonAnimSettingsExit),
transform: [
{ scale: withTiming(0.7, PapillonAnimSettingsExit) },
{ translateY: withTiming(-20, PapillonAnimSettingsExit) },
{ translateX: withTiming(0, PapillonAnimSettingsExit) },
{ scale: withTiming(ExitingScale, PapillonAnimSettingsExit) },
],
};
const initialValues = {
opacity: 1,
transform: [{ scale: 1 }, { translateY: 0 }, { translateX: 0 }],
transform: [{ scale: 1 }],
};
return {
initialValues,
Expand Down
32 changes: 17 additions & 15 deletions src/views/account/Chat/Modals/Chat.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useState} from "react";
import {ActivityIndicator, Platform, ScrollView, Text, View,} from "react-native";
import {ActivityIndicator, Platform, ScrollView, StyleSheet, Text, View,} from "react-native";
import {useTheme} from "@react-navigation/native";

import type {Screen} from "@/router/helpers/types";
Expand All @@ -11,7 +11,7 @@ import parse_initials from "@/utils/format/format_pronote_initials";
import InitialIndicator from "@/components/News/InitialIndicator";
import {PapillonModernHeader} from "@/components/Global/PapillonModernHeader";
import {useSafeAreaInsets} from "react-native-safe-area-context";
import RenderHTML from "react-native-render-html";
import HTMLView from "react-native-htmlview";
import Reanimated, {FadeIn, FadeOut} from "react-native-reanimated";
import {AccountService} from "@/stores/account/types";
import * as WebBrowser from "expo-web-browser";
Expand All @@ -24,6 +24,15 @@ const Chat: Screen<"Chat"> = ({ navigation, route }) => {
const theme = useTheme();
const { colors } = theme;

const stylesText = StyleSheet.create({
body: {
color: theme.colors.text,
fontFamily: "medium",
fontSize: 16,
lineHeight: 22,
}
});

const account = useCurrentAccount((state) => state.account!);
const [messages, setMessages] = useState<ChatMessage[]>([]);

Expand Down Expand Up @@ -101,19 +110,12 @@ const Chat: Screen<"Chat"> = ({ navigation, route }) => {
>
<NativeList>
<NativeItem>
<RenderHTML
source={{
html: messages[0].content.replaceAll(/<\/?font[^>]*>/g, ""),
}}
defaultTextProps={{
style: {
color: theme.colors.text,
fontFamily: "medium",
fontSize: 16,
lineHeight: 22,
},
}}
contentWidth={300}
<HTMLView
value={`<body>${messages[0].content.replaceAll(
/<\/?font[^>]*>/g,
""
)}</body>`}
stylesheet={stylesText}
/>
</NativeItem>
</NativeList>
Expand Down
Loading

0 comments on commit 1ba45d6

Please sign in to comment.