@@ -33,6 +33,8 @@ import useScreenSize from '../utils/useScreenSize';
33
33
import toBase64 from '../utils/toBase64' ;
34
34
import { isRunningAcceptanceTest } from '../utils/testUtils' ;
35
35
36
+ import { createClient } from '@supabase/supabase-js' ;
37
+
36
38
import { Transition } from 'react-transition-group' ;
37
39
38
40
import { useEffect , useMemo , useRef , useState } from 'react' ;
@@ -742,6 +744,17 @@ const Home: NextPage<HomeProperties> = ({ galleryPics }) => {
742
744
With that in mind, this is what I currently have in my toolbox 🧑🏽💻:
743
745
</ p >
744
746
< ul >
747
+ < li >
748
+ Mobile
749
+ < ul >
750
+ < li >
751
+ < TextLink href = "https://github.com/gmadridsports/app-natacion" >
752
+ Flutter
753
+ </ TextLink >
754
+ </ li >
755
+ < li > Supabase</ li >
756
+ </ ul >
757
+ </ li >
745
758
< li >
746
759
Frontend
747
760
< ul >
@@ -764,8 +777,11 @@ const Home: NextPage<HomeProperties> = ({ galleryPics }) => {
764
777
< ul >
765
778
< li > Agile: kanban and scrum</ li >
766
779
< li > Kubernetes</ li >
767
- < li > Hexagonal architecture</ li >
768
- < li > DDD</ li >
780
+ < li > Clean architectures: hexagonal, DDD, even on front</ li >
781
+ < li >
782
+ Foster < strong > async</ strong > - yet effective - communication
783
+ within a team
784
+ </ li >
769
785
</ ul >
770
786
</ li >
771
787
</ ul >
@@ -994,51 +1010,55 @@ export async function getServerSideProps() {
994
1010
} ;
995
1011
}
996
1012
997
- const response = await fetch (
998
- 'https://www.amazon.it/drive/v1/nodes/mmVUOJzUS_KqKRykQrzFPA/children?asset=ALL&filters=kind%3A(FILE*+OR+FOLDER*)+AND+contentProperties.contentType%3A(image*)+AND+status%3A(AVAILABLE*)&limit=15&lowResThumbnail=true&searchOnFamily=true&sort=%5B%27contentProperties.contentDate+DESC%27%5D&tempLink=true&shareId=qFervNlenYwkjdQ1o26YOsWhld5fnsJ0t89xbcv2Vep&offset=0&resourceVersion=V2&ContentType=JSON&_=1660508015523'
999
- ) ;
1013
+ const supabaseUrl = process . env . SUPABASE_NEXT_PUBLIC_SUPABASE_URL || '' ;
1014
+ const supabaseAnonKey =
1015
+ process . env . SUPABASE_NEXT_PUBLIC_SUPABASE_ANON_KEY || '' ;
1000
1016
1001
- if ( ! response ?. body ) {
1002
- return [ ] ;
1017
+ const supabase = createClient ( supabaseUrl , supabaseAnonKey , {
1018
+ global : {
1019
+ headers : {
1020
+ Authorization : `Bearer ${ process . env . SUPABASE_SUPABASE_SERVICE_ROLE_KEY } ` ,
1021
+ } ,
1022
+ } ,
1023
+ } ) ;
1024
+ const { data, error } = await supabase
1025
+ . from ( 'gallery-images' )
1026
+ . select ( 'url, name, height, width' )
1027
+ . limit ( 30 )
1028
+ . order ( 'created_at' , { ascending : false } ) ;
1029
+
1030
+ if ( data === null ) {
1031
+ throw new Error ( error ?. message ) ;
1003
1032
}
1004
1033
1005
- const data = await response . json ( ) ;
1006
-
1007
- const images = data . data . map (
1008
- ( photo : {
1009
- contentProperties : { image : { height : number ; width : number } } ;
1010
- tempLink : string ;
1011
- name : string ;
1012
- } ) => {
1013
- const { height : originalHeight , width : originalWidth } =
1014
- photo . contentProperties . image ;
1015
- const dimensionsRatio = originalHeight / originalWidth ;
1016
- const thumbnailFitWidth =
1017
- originalHeight > 200
1018
- ? [ 200 , 200 / dimensionsRatio ]
1019
- : [ originalHeight , originalWidth ] ;
1020
- const thumbnailFit =
1021
- originalWidth > 150
1022
- ? [ thumbnailFitWidth [ 0 ] * dimensionsRatio , 150 ]
1023
- : thumbnailFitWidth ;
1024
-
1025
- return {
1026
- src : photo . tempLink ,
1027
- name : photo . name ,
1028
- dimensions : {
1029
- ratio : dimensionsRatio ,
1030
- thumbnail : {
1031
- height : thumbnailFit [ 0 ] ,
1032
- width : thumbnailFit [ 1 ] ,
1033
- } ,
1034
- original : {
1035
- height : originalHeight ,
1036
- width : originalWidth ,
1037
- } ,
1034
+ const images = data . map ( ( photo ) => {
1035
+ const { height : originalHeight , width : originalWidth } = photo ;
1036
+ const dimensionsRatio = originalHeight / originalWidth ;
1037
+ const thumbnailFitWidth =
1038
+ originalHeight > 200
1039
+ ? [ 200 , 200 / dimensionsRatio ]
1040
+ : [ originalHeight , originalWidth ] ;
1041
+ const thumbnailFit =
1042
+ originalWidth > 150
1043
+ ? [ thumbnailFitWidth [ 0 ] * dimensionsRatio , 150 ]
1044
+ : thumbnailFitWidth ;
1045
+
1046
+ return {
1047
+ src : photo . url ,
1048
+ name : photo . name ,
1049
+ dimensions : {
1050
+ ratio : dimensionsRatio ,
1051
+ thumbnail : {
1052
+ height : thumbnailFit [ 0 ] ,
1053
+ width : thumbnailFit [ 1 ] ,
1038
1054
} ,
1039
- } ;
1040
- }
1041
- ) ;
1055
+ original : {
1056
+ height : originalHeight ,
1057
+ width : originalWidth ,
1058
+ } ,
1059
+ } ,
1060
+ } ;
1061
+ } ) ;
1042
1062
1043
1063
return {
1044
1064
props : {
0 commit comments