From baa81b3b048d821372f4952bb0e7fe0d50e53cd6 Mon Sep 17 00:00:00 2001 From: Matthew Turk Date: Thu, 14 Jul 2022 01:03:01 -0400 Subject: [PATCH 01/19] Experimenting with UI Kitten --- App.js | 12 ++++-- helpers/render.js | 10 +++++ navigation/index.js | 14 +++---- package.json | 3 ++ screens/Home.js | 62 ++++++++++++++--------------- yarn.lock | 96 ++++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 152 insertions(+), 45 deletions(-) create mode 100644 helpers/render.js diff --git a/App.js b/App.js index 55f4ab2e..dcd03780 100644 --- a/App.js +++ b/App.js @@ -13,6 +13,8 @@ import { getAuth, signInWithCustomToken, signInWithEmailAndPassword } from 'fire import { APIKEY, MESSAGING_SENDER_ID, APP_ID, MEASUREMENT_ID, FIREBASE_PASSWORD, SERVICE_ACCOUNT_ID } from '@env' import { getPostAsync } from './helpers/wpapi' import { Strings } from './constants' +import * as eva from '@eva-design/eva'; +import { ApplicationProvider } from '@ui-kitten/components'; Notifications.setNotificationHandler({ handleNotification: async () => ({ @@ -101,10 +103,12 @@ export default function App() { }; }, []); - return ( - - - ) + return ( + + + + + ) } diff --git a/helpers/render.js b/helpers/render.js new file mode 100644 index 00000000..c76f0395 --- /dev/null +++ b/helpers/render.js @@ -0,0 +1,10 @@ +import { ListItem } from "@ui-kitten/components"; +import { decode } from "html-entities"; +import Byline from "../components/Byline"; + +export const renderRow = ({ item, index }) => ( + + ); \ No newline at end of file diff --git a/navigation/index.js b/navigation/index.js index 32ed9a15..8f3874ef 100644 --- a/navigation/index.js +++ b/navigation/index.js @@ -18,21 +18,21 @@ export default function Navigation({ colorScheme }) { linking={LinkingConfiguration} theme={colorScheme === 'dark' ? DarkTheme : DefaultTheme} ref={navigationRef}> - + ); } // A root stack navigator is often used for displaying modals on top of all other content // Read more here: https://reactnavigation.org/docs/modal -const RootStack = createNativeStackNavigator(); +const Stack = createNativeStackNavigator(); -function RootNavigator() { +function NavigationRoot() { return ( - - - - + + + + ); } diff --git a/package.json b/package.json index d0aeef59..c2310803 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,14 @@ "eject": "expo eject" }, "dependencies": { + "@eva-design/eva": "^2.1.1", "@expo-google-fonts/open-sans": "^0.2.0", "@expo-google-fonts/pt-serif": "^0.2.0", "@native-html/iframe-plugin": "^1.1.2", "@react-navigation/native": "^6.0.2", "@react-navigation/native-stack": "^6.0.4", "@react-navigation/stack": "^6.0.4", + "@ui-kitten/components": "^5.1.2", "expo": "^45.0.0", "expo-constants": "~13.1.1", "expo-device": "~4.2.0", @@ -39,6 +41,7 @@ "react-native-screens": "~3.11.1", "react-native-skeleton-content": "^1.0.24", "react-native-snap-carousel": "^3.9.1", + "react-native-svg": "^12.3.0", "react-native-web": "0.17.7", "react-native-webview": "11.18.1", "superagent": "^6.1.0", diff --git a/screens/Home.js b/screens/Home.js index 26206a23..0419530b 100644 --- a/screens/Home.js +++ b/screens/Home.js @@ -8,23 +8,18 @@ import NewsFeedItem from '../components/NewsFeedItem'; import LightboxGallery from '../components/LightboxGallery'; import CategoryHeader from '../components/CategoryHeader'; import CardRow from '../components/CardRow'; -import Card from '../components/Card'; +// import Card from '../components/Card'; import _ from 'lodash'; import { getThumbnailURL, formatDate } from '../helpers/format'; import Column from '../components/Column'; +import { Card, Divider, List, ListItem } from '@ui-kitten/components'; +import { renderRow } from '../helpers/render'; +import { Image } from 'react-native'; +import { ImageBackground } from 'react-native'; const categoryHome = CategorySlugs[0]; const { width, height } = Dimensions.get('window'); -// then(function(data) { -// // do something with the returned posts -// console.log(data) -// return data -// }).catch(function(err) { -// // handle error -// console.log(err) -// }); - export default function Home(props) { const [category, setCategory] = useState(categoryHome); @@ -52,11 +47,14 @@ export default function Home(props) { const _renderCardRow = ({item}) => { return ( - props.navigation.navigate(Strings.post, { item: item })} - /> + ()} + footer={8 HOURS AGO}> + {/* might also have it switch from date or name depending on whether Grind article or news/sports */} + + The Maldives, officially the Republic of Maldives + + ); }; @@ -117,8 +115,24 @@ export default function Home(props) { /> + + + + + props.navigation.navigate(STRINGS.CATEGORY, { data: allArticles['sports'], title: 'Sports', navigation: props.navigation })} + /> + + item.length === 3)} + data={_.chunk(allArticles['artsAndLife'], 3).filter(item => item.length === 3)} renderItem={_renderColumn} sliderWidth={width} itemWidth={0.92*width} @@ -135,22 +149,6 @@ export default function Home(props) { })}}} /> - - props.navigation.navigate(STRINGS.CATEGORY, { data: allArticles['sports'], title: 'Sports', navigation: props.navigation })} - /> - - - props.navigation.navigate(STRINGS.CATEGORY, { data: allArticles['artsAndLife'], title: 'Arts and Life', navigation: props.navigation })} - /> - Date: Fri, 15 Jul 2022 21:17:01 -0400 Subject: [PATCH 02/19] Added `PagerView` --- constants/CategorySlugs.js | 11 -- constants/HomeSections.js | 11 -- constants/Sections.js | 50 +++++++++ constants/index.js | 3 +- dummy.json | 1 + helpers/format.js | 8 ++ package.json | 1 + screens/Home.js | 207 +++++++------------------------------ screens/News.js | 60 +++++++++++ yarn.lock | 5 + 10 files changed, 163 insertions(+), 194 deletions(-) delete mode 100644 constants/CategorySlugs.js delete mode 100644 constants/HomeSections.js create mode 100644 constants/Sections.js create mode 100644 dummy.json create mode 100644 screens/News.js diff --git a/constants/CategorySlugs.js b/constants/CategorySlugs.js deleted file mode 100644 index b0cd6171..00000000 --- a/constants/CategorySlugs.js +++ /dev/null @@ -1,11 +0,0 @@ -export default [ - {name: "Front Page", slug: null}, - {name: "News", slug: "news"}, - {name: "Sports", slug: "sports"}, - {name: "Arts & Life", slug: "arts-life"}, - {name: "Opinions", slug: "opinions"}, - {name: "The Grind", slug: "thegrind"}, - {name: "Humor", slug: "humor"}, - {name: "Data", slug: "@94305"}, - {name: "Podcasts", slug: "podcasts"} -]; \ No newline at end of file diff --git a/constants/HomeSections.js b/constants/HomeSections.js deleted file mode 100644 index 4718e4d2..00000000 --- a/constants/HomeSections.js +++ /dev/null @@ -1,11 +0,0 @@ -export default [ - "featured", - "news", - "sports", - "opinions", - "theGrind", - "artsAndLife", - "cartoons", - "humor", - "moreFromTheDaily" -]; \ No newline at end of file diff --git a/constants/Sections.js b/constants/Sections.js new file mode 100644 index 00000000..44bcfe57 --- /dev/null +++ b/constants/Sections.js @@ -0,0 +1,50 @@ +export default { + FEATURED: { + name: "Featured", + slug: "featured", + id: 1485 + }, + NEWS: { + name: "News", + slug: "news", + id: 3 + }, + SPORTS: { + name: "Sports", + slug: "sports", + id: 23 + }, + OPINIONS: { + name: "Opinions", + slug: "opinions", + id: 24 + }, + THE_GRIND: { + name: "The Grind", + slug: "theGrind", + id: 32278 + }, + ARTS_LIFE: { + name: "Arts & Life", + slug: "artsAndLife", + id: 25 + }, + CARTOONS: { + name: "Cartoons", + slug: "cartoons", + id: 41527 + }, + HUMOR: { + name: "Humor", + slug: "humor", + id: 55796 + }, + PODCASTS: { + name: "Podcasts", + slug: "podcasts" + }, + MORE_FROM_DAILY: { + name: "More from The Daily", + slug: "moreFromTheDaily" + } +} diff --git a/constants/index.js b/constants/index.js index afd9af9c..9d8d8204 100644 --- a/constants/index.js +++ b/constants/index.js @@ -1,7 +1,6 @@ export { default as Colors } from './PlatformPalette' export { default as Strings } from './Strings' -export { default as HomeSections } from './HomeSections' -export { default as CategorySlugs } from './CategorySlugs' +export { default as Sections } from './Sections' export { default as Fonts } from './Fonts' export { default as Margins } from './Margins' export { default as Alignments } from './Alignments' diff --git a/dummy.json b/dummy.json new file mode 100644 index 00000000..81dea6fc --- /dev/null +++ b/dummy.json @@ -0,0 +1 @@ +[{"id":1206172,"date":"2022-07-13T23:25:49","date_gmt":"2022-07-14T06:25:49","guid":{"rendered":"https:\/\/stanforddaily.com\/?p=1206172"},"modified":"2022-07-14T17:23:06","modified_gmt":"2022-07-15T00:23:06","slug":"ex-med-school-faculty-member-sentenced-for-sexual-battery","status":"publish","type":"post","link":"https:\/\/stanforddaily.com\/2022\/07\/13\/ex-med-school-faculty-member-sentenced-for-sexual-battery\/","title":{"rendered":"Ex-Med School faculty member sentenced for sexual battery"},"content":{"rendered":"\n

Content warning: This story contains references to sexual abuse. <\/em><\/p>\n\n\n\n

Former Stanford faculty member John Giacomini was sentenced<\/a> to eight months in prison for sexual battery of a colleague on Tuesday. The felony of sexual battery, which Giacomini pleaded guilty to earlier this year, took place at the Veterans Affairs (VA) Hospital in Palo Alto. Several former colleagues from Stanford and the Palo Alto VA advocated for Giacomini’s character in letters of support to the court, prior to his sentencing. <\/p>\n\n\n\n

Giacomini led the cardiology department of the Palo Alto VA from 1985 to 2018. He also directed the Stanford Cardiology Fellowship and served as a Stanford Medicine faculty member. He lost<\/a> those positions in 2018 when the accusations of sexual violence emerged. Stanford Medicine placed Giacomini on leave in June 2018 when they learned of the complaint, wrote Julie Greicius, a Stanford Healthcare spokesperson, in a statement to The Daily. Giacomini “permanently left Stanford shortly thereafter, when the investigation resulted in grounds to terminate his contract,” Greicius wrote.<\/p>\n\n\n\n

The case was referred to the U.S. Attorney’s Office by the Department of Veterans Affairs because it occurred on federal property at the Palo Alto VA. Giacomini was indicted<\/a> in 2020 by a federal grand jury and later pleaded guilty in March of this year, three days before his trial was set to begin. On Tuesday, Judge Freeman sentenced Giacomini to pay a fine of $15,000, undergo a special assessment and serve one year of supervised release in addition to his prison term.<\/p>\n\n\n\n

The victim told<\/a> the court that “the primary reason I reported these events was to help prevent this from happening to anyone else again, especially women fellows in the field of cardiology,” during the sentencing. Giacomini began his unsolicited sexual contact with one of the victims in the fall of 2017. They resigned at the end of that year, following multiple instances of sexual harassment and abuse. <\/p>\n\n\n\n

His attorney requested a more lenient sentence — home confinement instead of prison — in light of the letters of support and Giacomini’s age and health.<\/p>\n\n\n\n

Paul Yock, a current Stanford Medicine faculty member and the founding director of the Byers Center for Biodesign, wrote in a letter of support that he did “not have any direct knowledge of the issues leading to [Giacomini’s] recent legal issues.” <\/p>\n\n\n\n

Yock concluded the letter by emphasizing his personal and professional admiration of Giacomini and respect for “his deep commitment both to his clinical practice and to the training of young physicians and scientists.”<\/p>\n\n\n\n

​​Current Stanford Medicine faculty members Todd J. Brinton and Thomas Rando, as well as former faculty members Maurice Buchbinder and Michael Pham, submitted letters in support of Giacomini. Connor O’Brien, Laura Dodera, William L. Bennett, Judy Baer, Tanta Blodget, Cheryl Leppi and Svetlana Gorbunova were also among the former colleagues who submitted letters in support of Giacomini.<\/p>\n\n\n\n

Anthony Brass, Giacomini’s attorney, said he was “grateful for the letters,” adding that “the letters were speaking to the human side of the doctor, but were not on the subject of guilt and innocence as he had already accepted full responsibility.”<\/p>\n\n\n\n

The prosecutors wrote in their sentencing memorandum, a partially-redacted copy of which was obtained by The Daily, that “sexual abuse is a crime of power. Abusers use their power to intimidate, molest, and silence the victim — usually in that order.”<\/p>\n\n\n\n

The memo cites a witness “who believed that Dr. Giacomini and his supporters retaliated against her professionally after she rebuffed his attempts to pursue a romantic relationship with her.”<\/p>\n\n\n\n

Referencing the letters of support, the prosecutors wrote that “a cursory review of Dr. Giacomini’s many letters of support conveys his power and prestige within the profession.” According to the prosecutors, “this power differential between Dr. Giacomini and Victim was an extremely aggravating factor severely undermining any pretense of her consent to his sexual advances.” <\/p>\n\n\n\n

The letters from his colleagues do not explicitly discuss an appropriate sentence but emphasize their positive view of his character and professional accomplishments. <\/p>\n\n\n\n

Stanford law professor and survivor advocate Michele Dauber wrote that “it is disturbing and shocking to realize that the victim has read these letters and knows that her fellow physicians stood with the abuser and not with her,” in a statement to The Daily. “His conviction for his crimes directly contradicts any notion that he was a good mentor,” she wrote.<\/p>\n\n\n\n

Dauber wrote that Giacomini’s conviction was indicative of widespread issues at the university, pointing to the series<\/a> of allegations made by female faculty at the Stanford School of Medicine regarding “unchecked sexual harassment.” <\/p>\n\n\n\n

Stanford Medicine has zero tolerance for sexual harassment, Greicius added, and there are “robust policies in place to address these matters.”<\/p>\n\n\n\n

“If any of our faculty, staff or students is experiencing or has experienced harassment or discrimination in our community, we want to hear from them,” Greicius wrote. <\/p>\n\n\n\n

This article has been updated to include comment from Stanford Medicine. <\/em><\/p>\n\n\n\n

A previous version of this story inaccurately attributed a quote to Michele Dauber. That quote has been removed. The Daily regrets this error.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

Despite considerable support from former colleagues, former Stanford faculty member John Giacomini was sentenced to eight months in prison for a charge of sexual battery, which he pled guilty to earlier this year.<\/p>\n","protected":false},"author":1003222,"featured_media":1184171,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[40971,3],"tags":[10131,78305,10688,35551,6749,78306],"site-layouts":[],"coauthors":[75813],"parsely":{"version":"1.1.0","meta":{"@context":"https:\/\/schema.org","@type":"NewsArticle","mainEntityOfPage":{"@type":"WebPage","@id":"http:\/\/stanforddaily.com\/2022\/07\/13\/ex-med-school-faculty-member-sentenced-for-sexual-battery\/"},"headline":"Ex-Med School faculty member sentenced for sexual battery","url":"http:\/\/stanforddaily.com\/2022\/07\/13\/ex-med-school-faculty-member-sentenced-for-sexual-battery\/","thumbnailUrl":"https:\/\/stanforddaily.com\/wp-content\/uploads\/2021\/08\/IMG_0640-2.JPG-HOLDEN-FOREMAN_The-Stanford-Daily.jpg?w=300&h=300&crop=1","image":{"@type":"ImageObject","url":"https:\/\/stanforddaily.com\/wp-content\/uploads\/2021\/08\/IMG_0640-2.JPG-HOLDEN-FOREMAN_The-Stanford-Daily.jpg"},"dateCreated":"2022-07-14T06:25:49Z","datePublished":"2022-07-14T06:25:49Z","dateModified":"2022-07-15T00:23:06Z","articleSection":"Breaking News","author":[{"@type":"Person","name":"Bryan Steven Monge Serrano"}],"creator":["Bryan Steven Monge Serrano"],"publisher":{"@type":"Organization","name":"The Stanford Daily","logo":"https:\/\/stanforddaily.com\/wp-content\/uploads\/2019\/03\/cropped-DailyIcon-CardinalRed.png"},"keywords":["activism","palo alto veteran's hospital","sexual abuse","stanford hospital","stanford medicine","veterans affairs (va) palo alto health care system"]},"rendered":"