From 705f6a1324a08d58dc93a70e8ebe5e60c12ef053 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 12 May 2023 23:24:30 -0700 Subject: [PATCH] deleted hackerweb --- examples/hacker-web.md | 213 ----------------------------------------- 1 file changed, 213 deletions(-) delete mode 100644 examples/hacker-web.md diff --git a/examples/hacker-web.md b/examples/hacker-web.md deleted file mode 100644 index 55fa72628..000000000 --- a/examples/hacker-web.md +++ /dev/null @@ -1,213 +0,0 @@ - -# Aider modifying HackerWeb - -> Here we explore and modify the open source HackerWeb app https://github.com/cheeaun/hackerweb-native - - ---- -#### > what is this repo? - -This repository appears to be a React Native project for a Hacker News client application. It contains source code, images, and configuration files for both iOS and Android platforms. The project structure includes components, views, actions, and stores, which are typical in a React Native application. - - ---- -#### > how many stories does it show on a page? - -To answer your question, I need to see the contents of the file where the number of stories per page is defined. Please provide the contents of the `views/StoriesView.js` file. - -_views/StoriesView.js_ -_Add these files to the chat? y_ - -Apologies for the oversight. In the `views/StoriesView.js` file, the number of stories per page is determined by the `pageSize` property of the `ListView` component. Here's the relevant code: - -```javascript - -``` - -This means that the application shows 10 stories per page. - - ---- -#### > let's show 20 stories instead - -To show 20 stories per page, you need to update the `pageSize` property of the `ListView` component in the `views/StoriesView.js` file. Here's the change: - -```javascript -views/StoriesView.js -<<<<<<< ORIGINAL - pageSize={10} -======= - pageSize={20} ->>>>>>> UPDATED -``` - -Now, the application will display 20 stories per page. - -_Applied edit to views/StoriesView.js_ -_Commit 254f91e aider: Changed the number of stories per page to 20._ - ---- -#### > right now, in the main view which lists the stories ... when i click on the main area of a story entry, it opens the linked webpage. and on the right is a speech bubble that links me to the comments. can we reverse that logic? so the primary action takes me to the comments. and switch the bubble to another icon indicating an offsite link, which should take me to the linked webpage? - -To reverse the logic and change the icons, we need to modify the following files: - -1. components/StoryRow.js -2. images/comment-arrow.*.png (replace with a new icon for the offsite link) -3. images/comments-icon.*.png (replace with a new icon for the comments) - -Please provide the new icons for the offsite link and comments, and I will guide you through the changes in the code. - -_components/StoryRow.js_ -_Add these files to the chat? y_ - -I apologize for the confusion. Since you have provided the content of components/StoryRow.js, we can proceed with the changes. However, I still need the new icons for the offsite link and comments to guide you through the changes in the code. Please provide the new icons, and I will help you with the modifications. - - ---- -#### > what should i call them? - -You can name the new icons as follows: - -1. For the offsite link icon, name it `offsite-link-icon` and create variations for different resolutions like `offsite-link-icon@2x.png`, `offsite-link-icon@3x.png`, `offsite-link-icon.android.png`, `offsite-link-icon@2x.android.png`, and `offsite-link-icon@3x.android.png`. - -2. For the comments icon, name it `new-comments-icon` and create variations for different resolutions like `new-comments-icon@2x.png`, `new-comments-icon@3x.png`, `new-comments-icon.android.png`, `new-comments-icon@2x.android.png`, and `new-comments-icon@3x.android.png`. - -Once you have the new icons, I will guide you through the changes in the code. - - ---- -#### > done - -Great! Now that you have the new icons, let's proceed with the changes in the code. - -In `components/StoryRow.js`, we will swap the onPress actions for the main story area and the icon area, and update the icon sources. - -```javascript -components/StoryRow.js -<<<<<<< ORIGINAL - -======= - ->>>>>>> UPDATED - -... - -components/StoryRow.js -<<<<<<< ORIGINAL - - - - - -======= - - - - - ->>>>>>> UPDATED - -... - -components/StoryRow.js -<<<<<<< ORIGINAL - - - - {position} - - - {data.title} - {externalLink && {domainify(url)}} - {(() => { - if (type == 'job'){ - return {time_ago}; - } else { - const commentsText = comments_count>0 && · {comments_count} comment{comments_count != 1 && 's'}; - return ( - - {points} point{points != 1 && 's'} by {data.user} - {time_ago}{commentsText} - - ); - } - })()} - - {type != 'job' && (() => { - if (externalLink){ - return ( - - - - - - ); - } else if (isIOS){ - return ( - - - - ); - } - })()} - - -======= - - - - {position} - - - {data.title} - {externalLink && {domainify(url)}} - {(() => { - if (type == 'job'){ - return {time_ago}; - } else { - const commentsText = comments_count>0 && · {comments_count} comment{comments_count != 1 && 's'}; - return ( - - {points} point{points != 1 && 's'} by {data.user} - {time_ago}{commentsText} - - ); - } - })()} - - {type != 'job' && (() => { - if (externalLink){ - return ( - - - - - - ); - } else if (isIOS){ - return ( - - - - ); - } - })()} - - ->>>>>>> UPDATED -``` - -These changes will swap the onPress actions for the main story area and the icon area, and update the icon sources to use the new offsite link and comments icons. - -_Applied edit to components/StoryRow.js_ -_Applied edit to components/StoryRow.js_ -_Applied edit to components/StoryRow.js_ -_Commit dfb27aa aider: Swapped the onPress actions for the main story area and the icon area, and updated the icon sources to use new offsite link and comments icons._ - ---- -#### > /diff -_^C again to quit_