Skip to content

Commit

Permalink
Merge branch 'main' into feature/CU-34ga47h
Browse files Browse the repository at this point in the history
  • Loading branch information
toto04 committed Feb 3, 2023
2 parents 8372a6f + df3cfed commit b15dc92
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 32 deletions.
14 changes: 12 additions & 2 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import React, { useEffect, useRef, useState } from "react"
import { NavigationContainer } from "@react-navigation/native"
import { NavigationContainer, DefaultTheme } from "@react-navigation/native"
import { hideAsync } from "expo-splash-screen"
import { useFonts } from "@expo-google-fonts/roboto"
import {
Expand All @@ -20,10 +20,12 @@ import { LoginContext, LoginState } from "contexts/login"
import { SettingsContext, Settings } from "contexts/settings"
import { useLoadTokens } from "utils/loadTokens"
import { HttpClient } from "api/HttpClient"
import { usePalette } from "utils/colors"

const client = HttpClient.getInstance()

export default function App() {
const { homeBackground } = usePalette()
const [settingsReady, setSettingsReady] = useState(false)
const [settings, setSettings] = useState<Settings>({
theme: "predefined",
Expand Down Expand Up @@ -130,7 +132,15 @@ export default function App() {
if (!settingsReady || !fontsLoaded || !tokensLoaded) return null

return (
<NavigationContainer>
<NavigationContainer
theme={{
...DefaultTheme,
colors: {
...DefaultTheme.colors,
background: homeBackground,
},
}}
>
<OutsideClickProvider>
<SettingsContext.Provider
value={{ settings: settings, setSettings: setSettings }}
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
}
},
"name": "polifemo"
}
}
2 changes: 1 addition & 1 deletion src/components/Home/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const MainMenu: FC<{ filter?: string }> = ({ filter }) => {
key={"menu_add_row" + i}
style={{
flexDirection: "row",
marginVertical: 2,
marginVertical: 6,
width: 288,
}}
>
Expand Down
42 changes: 20 additions & 22 deletions src/components/Home/MenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const MenuButton: FC<{
justifyContent: "space-between",
alignItems: "center",
borderRadius: 10,
marginTop: 8, //added margin to the top due to the deleting operation
marginTop: 15, //added margin to the top due to the deleting operation
}}
>
<Canvas style={{ flex: 1, width: 40 }}>
Expand All @@ -111,31 +111,29 @@ export const MenuButton: FC<{
</Pressable>
{isDeleting && buttonIcon.id !== 9 && (
<Pressable
style={{
position: "absolute",
width: 25,
height: 25,
right: 0,
bottom: 57,
}}
onPress={() => {
onDelete && onDelete()
}}
hitSlop={10}
>
<View
style={{
position: "absolute",
width: 25,
height: 25,
right: 0,
bottom: 57,
}}
>
<Canvas style={{ flex: 1, width: 27 }}>
{delIcon && (
<ImageSVG
svg={delIcon}
x={0}
y={0}
width={25}
height={25}
/>
)}
</Canvas>
</View>
<Canvas style={{ flex: 1, width: 27 }}>
{delIcon && (
<ImageSVG
svg={delIcon}
x={0}
y={0}
width={25}
height={25}
/>
)}
</Canvas>
</Pressable>
)}
</Animated.View>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home/PoliSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const PoliSearchBar: FC<{
<Animated.View
style={{
marginTop: 46,
marginBottom: 18,
marginBottom: 12,
marginHorizontal: 52,
borderRadius: 28,
backgroundColor: fieldBackground,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import { NavBar } from "components/NavBar"
// absolute magic url that makes the login go brrr, going to this url prompts the user to log in
// for microsoft sso using polimi creditials
const magicLoginUrl =
"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?client_id=92602f24-dd8e-448e-a378-b1c575310f9d&scope=openid%20offline_access&response_type=code&login_hint=nome.cognome@mail.polimi.it&state=10010&redirect_uri=https://api.polinetwork.org/v1/auth/code"
"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=92602f24-dd8e-448e-a378-b1c575310f9d&scope=openid%20offline_access&response_type=code&state=10010&redirect_uri=https://api.polinetwork.org/staging/v1/auth/code&login_hint=nome@mail.polimi.it"
// with a polimi session present, this cascade-redirects to the app page with the authcode attached
const magicTokenUrl =
"https://oauthidp.polimi.it/oauthidp/oauth2/auth?client_id=1057407812&redirect_uri=https%3A%2F%2Fpolimiapp.polimi.it%2Fpolimi_app%2Fapp&scope=openid%20polimi_app%20aule%20policard%20incarichi%20orario%20account%20webmail%20faqappmobile%20rubrica%20richass%20guasti%20prenotazione%20code%20carriera%20alumni%20webeep%20teamwork%20esami&access_type=offline&response_type=code"

// if this is reached we have reached the polinework access token
const polinetworkTargetUrl = "https://api.polinetwork.org/v1/auth/code"
const polinetworkTargetUrl = "https://api.polinetwork.org/staging/v1/auth/code"
// once this is reached we can extract polimi authcode from the url
const polimiTargetUrl = "https://polimiapp.polimi.it/polimi_app/app/?code="

Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11016,9 +11016,9 @@ typescript@^4.6.3:
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==

ua-parser-js@^0.7.30:
version "0.7.32"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.32.tgz#cd8c639cdca949e30fa68c44b7813ef13e36d211"
integrity sha512-f9BESNVhzlhEFf2CHMSj40NWOjYPl1YKYbrvIr/hFTDEmLq7SRbWvm7FcdcpCYT95zrOhC7gZSxjdnnTpBcwVw==
version "0.7.33"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532"
integrity sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==

uglify-es@^3.1.9:
version "3.3.9"
Expand Down

0 comments on commit b15dc92

Please sign in to comment.