File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ const PatronContainer = styled.div`
68
68
}
69
69
70
70
@media only screen and (max-width: 809px) {
71
+ width: 75%;
72
+
71
73
p {
72
74
font-size: 0.8rem;
73
75
font-weight: bold;
Original file line number Diff line number Diff line change @@ -150,3 +150,17 @@ export function elapsedBefore(
150
150
throw new Error ( type ) ;
151
151
}
152
152
}
153
+
154
+ export function sortByKey < T extends Record < string , any > > ( array : T [ ] , key : keyof T ) : T [ ] {
155
+ return array . sort ( ( a , b ) => {
156
+ const av = a [ key ] as any ;
157
+ const bv = b [ key ] as any ;
158
+
159
+ if ( av == null ) return - 1 ;
160
+ if ( bv == null ) return 1 ;
161
+ if ( typeof av === "number" && typeof bv === "number" ) return av - bv ;
162
+ if ( av instanceof Date && bv instanceof Date ) return av . getTime ( ) - bv . getTime ( ) ;
163
+
164
+ return av === bv ? 0 : av > bv ? 1 : - 1 ;
165
+ } ) ;
166
+ }
You can’t perform that action at this time.
0 commit comments