From e65e6095d92a83db38036b1f58a6058a8e9edaa4 Mon Sep 17 00:00:00 2001 From: Robert Lucas <100799838+Robert-M-Lucas@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:54:32 +0100 Subject: [PATCH] Added TipOfTheDayTile.tsx --- src/pages/dashboard/DashboardPage.tsx | 2 + .../tip of the day tile/TipOfTheDayTile.tsx | 45 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/pages/dashboard/tip of the day tile/TipOfTheDayTile.tsx diff --git a/src/pages/dashboard/DashboardPage.tsx b/src/pages/dashboard/DashboardPage.tsx index a4aca2e..4e5728c 100644 --- a/src/pages/dashboard/DashboardPage.tsx +++ b/src/pages/dashboard/DashboardPage.tsx @@ -19,6 +19,7 @@ import {RenderTileFunction, TilesContainer} from "react-tiles-dnd"; import goalTracking from "./goal tracking tile/GoalTrackingTile.tsx"; import motivationTile from "./motivation tile/MotivationTile.tsx"; import AddTransactionTile from "./add transaction tile/AddTransactionTile.tsx"; +import tipOfTheDayTile from "./tip of the day tile/TipOfTheDayTile.tsx"; export default function Dashboard() { // const [balance, setBalance] = useState(0); @@ -107,6 +108,7 @@ export default function Dashboard() { const transactionTiles: TileElement[] = [ TileElement.newTSX(() => totalTile(transactions), 2, 1, columns), TileElement.newTSX(() => (goalSettingTile(userPrefs, forceUpdatePrefs)), 2, 2, columns), + TileElement.newTSX(tipOfTheDayTile, 2, 1, columns), TileElement.newTSX(() => goalTracking(transactions, userPrefs), 3, 1, columns), TileElement.newTSX(() => motivationTile(transactions, userPrefs), 1, 1, columns), TileElement.newTSX(() => AddTransactionTile(forceUpdateTransactions), 1, 1, columns), diff --git a/src/pages/dashboard/tip of the day tile/TipOfTheDayTile.tsx b/src/pages/dashboard/tip of the day tile/TipOfTheDayTile.tsx new file mode 100644 index 0000000..0ac724b --- /dev/null +++ b/src/pages/dashboard/tip of the day tile/TipOfTheDayTile.tsx @@ -0,0 +1,45 @@ +import {ReactNode} from "react"; + +const tips = [ + ["Meal Prep Sunday", "Cook meals in bulk on Sundays to save both time and money during the week."], + ["Wants vs. Needs", "Before buying anything, ask yourself if it's a want or a need. Skip the wants if you're tight on budget."], + ["Library Over Bookstore", "Utilize your local library instead of buying books to stretch your entertainment dollars further."], + ["Subscription Review", "Take time today to review all your subscriptions. Cancel any that you haven't used in the last month."], + ["Plan Your Grocery List", "Make a grocery list before shopping to avoid impulse buys. Stick to the list!"], + ["Weekly Budget Review", "Take a few minutes to review your budget and spending habits from the past week. Adjust as needed."], + ["Set a Savings Goal", "Set a specific, achievable savings goal for something you really want or need. "], + ["Avoid ATM Fees", "Use your bank's ATM and avoid fees from other machines. "], + ["Refinance Debts", "Look into refinancing options for any loans or credit cards to reduce interest rates and save money. "], + ["Water Over Soda", "Drink water instead of soda when eating out. It's healthier and saves a bit on the bill. "], + ["Invest in Quality", "Sometimes, spending more upfront for quality means you save money in the long run. "], + ["Public Transport Passes", "If you frequently use public transport, consider buying a pass to save on individual tickets. "], + ["Utility Usage Off-Peak", "Use appliances like washers and dishwashers during off-peak energy hours to save on utilities."], + ["Automate Savings", "Set up an automatic transfer to your savings account every payday to ensure you consistently save without having to think about it."], + ["Debt Snowball Method", "Start paying off debts from smallest to largest. This method gives you quick wins and motivates you to tackle larger debts."], + ["Emergency Fund Focus", "Prioritize building an emergency fund that covers 3-6 months of living expenses. It's crucial for financial security."], + ["Review Insurance Plans", "Annually review your health, auto, and home insurance to ensure you're getting the best rates and adequate coverage."], + ["Analyze Bank Fees", "Review your banking fees and consider switching to a bank that offers better terms or no fees."], + ["Long-term Goals", "Set long-term financial goals, such as buying a home or starting a business, and create a plan to achieve them."], + ["Invest Wisely", "Educate yourself on investment options and consider diversifying your investments to minimize risks."], + ["Negotiate Bills", "Regularly call service providers to negotiate better rates on your cable, internet, and phone bills."], + ["Lifestyle Inflation", "Avoid increasing your spending as your income grows. Instead, direct any extra money towards savings or debt repayment."], + ["Health Savings Account", "If eligible, use a Health Savings Account (HSA) to save money tax-free for medical expenses."], + ["Understand Your Paycheck", "Fully understand the deductions and contributions on your paycheck to manage your income effectively."], + ["Monitor Mental Your Health", "Financial stress can affect your mental health. Recognize when you might need to seek help to manage stress effectively."], +]; + +export default function tipOfTheDayTile(): ReactNode { + const days = Math.floor(Date.now()/8.64e7); + const tip = tips[days % tips.length]; + + return <> +
+ Tip of the Day - {tip[0]} +
+
+ + {tip[1]} + +
+ ; +} \ No newline at end of file