+
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 35 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,53 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
# Rejected.us - Share Your Rejection Stories

## Available Scripts

In the project directory, you can run:
This project is a simple web application that displays a collection of "rejection stories" from various individuals, aiming to normalize and share these experiences. It was originally bootstrapped with Create React App.

### `npm start`
## Project Structure

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The main components of this application are:

The page will reload if you make edits.<br>
You will also see any lint errors in the console.
- `public/index.html`: The main HTML file.
- `src/index.js`: The entry point for the React application.
- `src/App.js`: The main application component that lays out the page and renders the list of stories.
- `src/Header.js`: The header component for the application.
- `src/Footer.js`: The footer component, including links for contributing.
- `src/Story.js`: A component responsible for rendering an individual story card. It takes a `story` object as a prop.
- `src/data/stories.js`: This file exports an array of JavaScript objects, where each object represents a story. Each story object contains details like `fullName`, `handle`, `avatar`, `story`, etc.

### `npm test`
## How to Contribute a Story

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
We welcome contributions! To add your own rejection story:

### `npm run build`
1. Fork the repository.
2. Open the `src/data/stories.js` file.
3. Add a new story object to the array, following the existing format. Make sure to include:
* `fullName`: Your full name.
* `handle`: Your Twitter/X handle (or other relevant social media handle).
* `website`: A link to your website or social media profile.
* `bio`: A short bio.
* `avatar`: The filename of your avatar image (e.g., `yourname.jpg`). Place this image in the `public/images/` directory.
* `story`: Your rejection story.
* `double`: (Optional) Set to `true` if you think your story might benefit from a wider display format (currently not implemented but planned for future).
4. Create a new branch for your changes.
5. Commit your changes and open a pull request against the main repository.

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.
## Available Scripts

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!
In the project directory, you can run:

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm start`

### `npm run eject`
Runs the app in the development mode. Open [http://localhost:3000](http://localhost:3000) to view it in the browser. The page will reload if you make edits.

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
### `npm test`

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Launches the test runner in the interactive watch mode.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
### `npm run build`

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
Builds the app for production to the `build` folder. It correctly bundles React in production mode and optimizes the build for the best performance.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
- [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started)
- [React documentation](https://reactjs.org/)
72 changes: 39 additions & 33 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-21008844-16"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-21008844-16"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "UA-21008844-16");
</script>
gtag("config", "UA-21008844-16");
</script>

<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
<meta charset="utf-8" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Mulish:ital,wght@0,200..1000;1,200..1000&display=swap"
rel="stylesheet"
/>

<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -37,12 +44,12 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Rejected.us</title>
</head>
<body>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root"></div>
<!--
<title>Rejected.us</title>
</head>
<body>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

Expand All @@ -51,6 +58,5 @@

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
--></body>
</html>
44 changes: 12 additions & 32 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,19 @@
import React from "react";
import Header from "./Header";
import Footer from "./Footer.js";
import storiesData from "./data/stories.js";
import Story from "./Story";

export default function App() {
const stories = storiesData.map((story) => {
return (
<div
key={story.handle}
className={story.double ? "Story Rejection--width2" : "Story"}
>
<img
alt={story.handle}
className="Story-image"
src={process.env.PUBLIC_URL + "/images/" + story.avatar}
/>
<span>
<span className="Story-fullname">{story.fullName}</span>
</span>
<span>
<a target="_blank" rel="noopener noreferrer" href={story.website}>
@{story.handle}
</a>
<span> </span>
<span className="Story-bio">{story.bio}</span>
<span> </span>
</span>
<p>{story.story}</p>
</div>
);
});
const stories = storiesData.map((story) => {
return <Story key={story.handle} story={story} />;
});

return (
<div>
<Header />
<div className="App-style">{stories}</div>
</div>
);
return (
<div className="main-container">
<Header />
<main className="app-container">{stories}</main>
<Footer />
</div>
);
}
18 changes: 18 additions & 0 deletions src/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";

export default function Footer() {
return (
<footer className="app-footer">
<p>
To add your own rejection story, please{" "}
<a href="https://github.com/Rejectedus/rejected.us/pulls/">
open a PR
</a>{" "}
or tweet me at <a href="https://x.com/jkup">@jkup</a>
</p>
<p>
Created by <a href="https://jonkuperman.com">Jon Kuperman</a>
</p>
</footer>
);
}
26 changes: 7 additions & 19 deletions src/Header.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import React from "react";

export default function Header() {
return (
<div>
<div className="app-header">
<h1 className="app-title">
<a href="/">We've all faced rejection.</a>
</h1>
<div>
To add your own rejection story, please{" "}
<a href="https://github.com/Rejectedus/rejected.us/pulls/">
open a PR
</a>{" "}
or tweet me at <a href="https://twitter.com/jkup">@jkup</a>
</div>
<div>
Created by <a href="https://jonkuperman.com">Jon Kuperman</a>
</div>
</div>
</div>
);
return (
<header className="app-header">
<h1 className="app-title">
<a href="/">We've all faced rejection.</a>
</h1>
</header>
);
}
39 changes: 39 additions & 0 deletions src/Story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';

const Story = ({ story }) => {
const { double } = story;

return (
<article key={story.handle} className={`story ${double ? 'story-double' : ''}`}>
<div className="story-header">
<span className="story-header-image">
<img
alt={story.handle}
className="story-image"
src={
process.env.PUBLIC_URL +
"/images/" +
story.avatar
}
/>
</span>
<div className="story-header-info">
<span className="story-fullname">{story.fullName}</span>
<span className="story-bio-container">
<a
target="_blank"
rel="noopener noreferrer"
href={story.website}
>
@{story.handle}
</a>
<span className="story-bio">{story.bio}</span>
</span>
</div>
</div>
<blockquote className="story-desc">{story.story}</blockquote>
</article>
);
};

export default Story;
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载