diff --git a/src/app/components/PublicacaoVisualizar.tsx b/src/app/components/PublicacaoVisualizar.tsx
index 5194240..92162ec 100644
--- a/src/app/components/PublicacaoVisualizar.tsx
+++ b/src/app/components/PublicacaoVisualizar.tsx
@@ -4,31 +4,13 @@ import { IPublicacaoUsuario } from "../interfaces/forum.interface";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import AntDesing from "react-native-vector-icons/AntDesign";
import { hasFoto } from "../shared/helpers/foto.helper";
-
+import { getFoto } from "../shared/helpers/photo.helper";
interface IProps {
item: IPublicacaoUsuario;
}
export default function PublicacaoVisualizar({ item }: IProps) {
- const getFoto = (foto: string | null | undefined) => {
- if (hasFoto(foto)) {
- return (
-
- );
- }
-
- return (
-
-
-
- );
- };
-
const getFormattedDate = (payload: Date | string): string => {
const date = new Date(payload);
return date.toLocaleDateString("pt-BR");
diff --git a/src/app/private/pages/cadastrarMetrica.tsx b/src/app/private/pages/cadastrarMetrica.tsx
index 156da57..5e6f5b7 100644
--- a/src/app/private/pages/cadastrarMetrica.tsx
+++ b/src/app/private/pages/cadastrarMetrica.tsx
@@ -15,9 +15,9 @@ import { router } from "expo-router";
import { postMetrica } from "../../services/metrica.service";
import { EMetricas, IMetrica } from "../../interfaces/metricas.interface";
import Toast from "react-native-toast-message";
-import { hasFoto
+import { hasFoto} from "../../shared/helpers/foto.helper";
+import { getFoto } from "../../shared/helpers/photo.helper";
- } from "../../shared/helpers/foto.helper";
export default function criarMetrica() {
const [user, setUser] = useState(undefined);
const [idoso, setIdoso] = useState();
@@ -45,20 +45,6 @@ export default function criarMetrica() {
});
};
- const getFoto = (foto: string | null | undefined) => {
- if (hasFoto(foto)) {
- return (
-
- );
- }
-
- return (
-
-
-
- );
- };
-
const handleMetricSelection = async (metricType: EMetricas) => {
const body = {
idIdoso: Number(idoso?.id),
diff --git a/src/app/private/tabs/perfil.tsx b/src/app/private/tabs/perfil.tsx
index ad9ad6c..4164ea2 100644
--- a/src/app/private/tabs/perfil.tsx
+++ b/src/app/private/tabs/perfil.tsx
@@ -6,7 +6,8 @@ import AsyncStorage from "@react-native-async-storage/async-storage";
import { IUser } from "../../interfaces/user.interface";
import { router } from "expo-router";
import NaoAutenticado from "../../components/NaoAutenticado";
-import { hasFoto, getFoto } from "../../shared/helpers/foto.helper";
+import { hasFoto } from "../../shared/helpers/foto.helper";
+import { getFoto } from "../../shared/helpers/photo.helper";
export default function Perfil() {
const [user, setUser] = useState(undefined);
@@ -40,20 +41,6 @@ export default function Perfil() {
});
};
- const getFoto = (foto: string | null | undefined) => {
- if (hasFoto(foto)) {
- return (
-
- );
- }
-
- return (
-
-
-
- );
- };
-
useEffect(() => handleUser(), []);
return !idUsuario ? (
diff --git a/src/app/private/tabs/registros.tsx b/src/app/private/tabs/registros.tsx
index e32fc0e..3c6fb86 100644
--- a/src/app/private/tabs/registros.tsx
+++ b/src/app/private/tabs/registros.tsx
@@ -16,6 +16,7 @@ import Toast from "react-native-toast-message";
import database from "../../db";
import { Q } from "@nozbe/watermelondb";
import { hasFoto } from "../../shared/helpers/foto.helper";
+import { getFoto } from "../../shared/helpers/photo.helper";
export default function Registros() {
const [user, setUser] = useState(undefined);
@@ -39,20 +40,6 @@ export default function Registros() {
});
};
- const getFoto = (foto: string | null | undefined) => {
- if (hasFoto(foto)) {
- return (
-
- );
- }
-
- return (
-
-
-
- );
- };
-
const visualizarMetrica = (item: IMetrica) => {
router.push({
pathname: "private/pages/visualizarMetrica",
diff --git a/src/app/private/tabs/rotinas.tsx b/src/app/private/tabs/rotinas.tsx
index 8813ae2..9255f43 100644
--- a/src/app/private/tabs/rotinas.tsx
+++ b/src/app/private/tabs/rotinas.tsx
@@ -31,7 +31,7 @@ import "moment/locale/pt-br";
import database from "../../db";
import { Collection, Q } from "@nozbe/watermelondb";
import Rotina from "../../model/Rotina";
-import { hasFoto } from "../../shared/helpers/foto.helper";
+import { getFoto } from "../../shared/helpers/photo.helper";
export default function Rotinas() {
moment.locale("pt-br");
@@ -62,20 +62,6 @@ export default function Rotinas() {
});
};
- const getFoto = (foto: string | null | undefined) => {
- if (hasFoto(foto)) {
- return (
-
- );
- }
-
- return (
-
-
-
- );
- };
-
const novaRotina = () => {
router.push({
pathname: "private/pages/cadastrarRotina",
diff --git a/src/app/shared/helpers/foto.helper.tsx b/src/app/shared/helpers/foto.helper.tsx
index 97502b4..0ebb511 100644
--- a/src/app/shared/helpers/foto.helper.tsx
+++ b/src/app/shared/helpers/foto.helper.tsx
@@ -1,17 +1,9 @@
// Funções auxiliares para foto:
-import { Image } from 'react-native'; // Import do Image para usar na função getFoto
+import { Image } from 'react-native';
import React from "react";
export const hasFoto = (foto: string | null | undefined): boolean => {
if (!foto) return false;
const raw = foto.split("data:image/png;base64,")[1];
return raw ? raw.length > 0 : false;
-};
-
-export const getFoto = (foto: string | null | undefined, styles: any) => {
- if (hasFoto(foto)) {
- return (
-
- );
- }
};
\ No newline at end of file