Replaced sponsorship package with a smaller one for faster loading time#123
Replaced sponsorship package with a smaller one for faster loading time#123str4wb3rrytea wants to merge 1 commit into
Conversation
WalkthroughBoth files have been reformatted with adjusted spacing and line breaks. No functional or behavioral changes are present; component structure, routing logic, and rendered output remain identical across all modifications. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@src/routes/Sponsors.jsx`:
- Around line 446-448: The inline styles on the Row and Col use invalid values
(display: 'float' and float: 'center'); remove those style entries and rely on
Bootstrap classes or valid CSS instead: delete style={{ display: 'float' }} from
the Row and style={{ float: 'center' }} from the Col in the Sponsors component,
and if you need explicit centering replace them with Bootstrap utilities such as
className="d-flex justify-content-center" or className="mx-auto" (or add a valid
CSS class) while keeping the existing justify-content-center and text-center
classes; apply the same changes to the other occurrence at the similar block
(lines ~464-466).
- Line 1: The import in Sponsors.jsx is wrong: change the invalid named import
"import { React } from 'react'" to either the default import "import React from
'react'" if the component uses the React namespace (e.g., React.useState) or
remove the import entirely if using the modern JSX transform and only using
hooks (instead import specific APIs like useState), so update the top-level
import for the Sponsors component accordingly.
| }; | ||
|
|
||
| export default Sponsors; | ||
| import { React } from 'react'; |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
React named export vs default export 'import { React }' vs 'import React'
💡 Result:
What the two syntaxes mean (JS modules)
import React from 'react'= default import (imports the module’s default export). Default exports are imported without braces. [1][2]import { React } from 'react'= named import (imports an export literally namedReact). Named exports are imported with braces and must match the exported name. [2]
So import { React } from 'react' typically fails because React’s public API isn’t exposed as a named export called React in normal usage—React APIs are exposed as named exports like useState, useEffect, createElement, etc. (and historically also a default export for React). [3]
What you should do in React apps today
- With the modern JSX transform, you usually do not need
Reactin scope just to write JSX anymore (it’s handled by the compiler). React 19 even says the new JSX transform is required. [4]
So you can often write:import { useState } from 'react';
- Import React APIs as named imports when you use them:
(
import { useState, useEffect, createElement } from 'react';
createElementis shown in the React docs as a named import.) [5]
If you want the “React.*” style
Use a namespace import (different from { React }):
import * as React from 'react';
React.useState(...);This is the “import everything under one name” form. [2]
Sources: MDN on import/export syntax [2][1], React docs on default vs named exports [3], React 19 upgrade guide (new JSX transform required / no React import needed for JSX) [4], React createElement docs (named import example) [5].
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export
[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
[3] https://react.dev/learn/importing-and-exporting-components
[4] https://react.dev/blog/2024/04/25/react-19-upgrade-guide
[5] https://react.dev/reference/react/createElement
Fix invalid React import.
react doesn't provide a named React export, so import { React } from 'react' will be undefined and break JSX usage. Use the default import instead:
-import { React } from 'react';
+import React from 'react';(Alternatively, with the modern JSX transform in React 17+, you may not need a React import at all for JSX—only import specific APIs like useState as needed.)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { React } from 'react'; | |
| import React from 'react'; |
🤖 Prompt for AI Agents
In `@src/routes/Sponsors.jsx` at line 1, The import in Sponsors.jsx is wrong:
change the invalid named import "import { React } from 'react'" to either the
default import "import React from 'react'" if the component uses the React
namespace (e.g., React.useState) or remove the import entirely if using the
modern JSX transform and only using hooks (instead import specific APIs like
useState), so update the top-level import for the Sponsors component
accordingly.
| <Row className="my-2 mx-2 gx-4 justify-content-center text-center" style={{ display: 'float' }}> | ||
| <Col md="auto" style={{ float: 'center' }}> | ||
| <SponsorLinkWithDesc logoTier="silver" image={mef} link="https://uwaterloo.ca/math-endowment-fund/" /> |
There was a problem hiding this comment.
Remove invalid inline CSS (display: 'float', float: 'center').
Those values are invalid and are ignored by the browser, which can lead to layout inconsistencies.
🧹 Suggested fix
-<Row className="my-2 mx-2 gx-4 justify-content-center text-center" style={{ display: 'float' }}>
- <Col md="auto" style={{ float: 'center' }}>
+<Row className="my-2 mx-2 gx-4 justify-content-center text-center">
+ <Col md="auto">
<SponsorLinkWithDesc logoTier="silver" image={mef} link="https://uwaterloo.ca/math-endowment-fund/" />
</Col>
- <Col md="auto" style={{ float: 'center' }}>
+ <Col md="auto">
<SponsorLinkWithDesc logoTier="silver" image={swagelok} link="http://www.swagelok.com/en" />
</Col>-<Row className="my-2 mx-2 gx-4 justify-content-center text-center" style={{ display: 'float' }}>
- <Col md="auto" style={{ float: 'center' }}>
+<Row className="my-2 mx-2 gx-4 justify-content-center text-center">
+ <Col md="auto">
<SponsorLinkWithDesc logoTier="silver" image={pelican} link="https://www.pelican.com/ca/en/" />
</Col>Also applies to: 464-466
🤖 Prompt for AI Agents
In `@src/routes/Sponsors.jsx` around lines 446 - 448, The inline styles on the Row
and Col use invalid values (display: 'float' and float: 'center'); remove those
style entries and rely on Bootstrap classes or valid CSS instead: delete
style={{ display: 'float' }} from the Row and style={{ float: 'center' }} from
the Col in the Sponsors component, and if you need explicit centering replace
them with Bootstrap utilities such as className="d-flex justify-content-center"
or className="mx-auto" (or add a valid CSS class) while keeping the existing
justify-content-center and text-center classes; apply the same changes to the
other occurrence at the similar block (lines ~464-466).
Description
I replaced the current sponsorship_pacakge2026.pdf file with a smaller one of the same name. This will hopefully reduce the time it takes to load the package. Its url is still the same.
This PR closes Niva's request in Slack.
Developer Testing
Testing done:
Reviewer Testing
Steps to view/test Feature X:
git clonethis reponpm installnpm run startThis change is
Summary by CodeRabbit
Note: This release contains no new features or bug fixes. All functionality remains unchanged.