diff --git a/package.json b/package.json index 3d1ff5b..1e1c914 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name" : "brew-my-mac", "description" : "Possibly the coolest way to install apps and customize your Mac!", - "version" : "1.0.4", + "version" : "1.0.5", "author" : { "name" : "Alan Tai" }, @@ -43,6 +43,7 @@ "flexsearch" : "^0.7.21", "ga-4-react" : "^0.1.281", "i18next" : "^21.9.1", + "markdown-to-jsx" : "^7.1.7", "minisearch" : "^5.0.0", "path-browserify" : "^1.0.1", "react" : "^18.2.0", @@ -55,8 +56,8 @@ "uuid" : "^9.0.0" }, "devDependencies" : { - "@babel/core" : "^7.19.0", - "@babel/preset-env" : "^7.19.0", + "@babel/core" : "^7.19.1", + "@babel/preset-env" : "^7.19.1", "@babel/preset-typescript" : "^7.18.6", "@babel/runtime" : "^7.19.0", "@testing-library/jest-dom" : "^5.16.5", diff --git a/public/data/disclaimer.md b/public/data/disclaimer.md new file mode 100644 index 0000000..2c1ba50 --- /dev/null +++ b/public/data/disclaimer.md @@ -0,0 +1,70 @@ +Last updated: September 15, 2022 + +# Interpretation and Definitions + +## Interpretation + +The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural. + +## Definitions + +For the purposes of this Disclaimer: + +* **Company** (referred to as either "the Company", "We", "Us" or "Our" in this Disclaimer) refers to BrewMyMac. +* **Service** refers to the Website. +* **You** means the individual accessing or using the Service, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable. +* **Website** refers to BrewMyMac, accessible from [https://brewmymac.com](https://brewmymac.com) + +# Disclaimer + +The information contained on the Service is for general information purposes only. + +The Company assumes no responsibility for errors or omissions in the contents of the Service. + +In no event shall the Company be liable for any special, direct, indirect, consequential, or incidental damages or any damages whatsoever, whether in an action of contract, negligence or other tort, arising out of or in connection with the use of the Service or the contents of the Service. The Company reserves the right to make additions, deletions, or modifications to the contents on the Service at any time without prior notice. + +The Company does not warrant that the Service is free of viruses or other harmful components. + +# External Links Disclaimer + +The Service may contain links to external websites that are not provided or maintained by or in any way affiliated with the Company. + +Please note that the Company does not guarantee the accuracy, relevance, timeliness, or completeness of any information on these external websites. + +# Errors and Omissions Disclaimer + +The information given by the Company is for general guidance on matters of interest only. Even if the Company takes every precaution to insure that the content of this Service is both current and accurate, errors can occur. Also, given the changing nature of laws, rules and regulations, there may be delays, omissions or inaccuracies in information contained on this Service. Therefore, the information on this Service is provided with the understanding that the authors and publishers are not herein engaged in rendering legal, accounting, tax, or other professional advice and services. As such, it should not be used as a substitute for consultation with professional accounting, tax, legal or other competent advisers. + +All information in this Service is provided "as is", with no guarantee of completeness, accuracy, timeliness or of the results obtained from the use of this information, and without warranty of any kind, express or implied, including, but not limited to warranties of performance, merchantability and fitness for a particular purpose. + +The Company will not be liable to you or anyone else for any decision made or action taken in reliance on the information in this Service or for any consequential, special or similar damages, even if advised of the possibility of such damages. + +# Fair Use Disclaimer + +This Service may contain copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. + +If You wish to use copyrighted material from this Service for purposes of your own that go beyond 'fair use', You must obtain permission from the copyright owner. + +# Views Expressed Disclaimer + +The Service may contain views and opinions which are those of the authors and do not necessarily reflect the official policy or position of any other author, agency, organization, employer or company, including the Company. + +Comments published by users are their sole responsibility and the users will take full responsibility, liability and blame for any libel or litigation that results from something written in or as a direct result of something written in a comment. The Company is not liable for any comment published by users and reserve the right to delete any comment for any reason whatsoever. + +# No Responsibility Disclaimer + +The information on this Service is provided with the understanding that the authors and publishers are not herein engaged in rendering legal, accounting, tax, or other professional advice and services. As such, it should not be used as a substitute for consultation with professional accounting, tax, legal or other competent advisers. + +In no event shall the Company or its suppliers be liable for any special, incidental, indirect, or consequential damages whatsoever arising out of or in connection with your access or use or inability to access or use the Service. + +# "Use at Your Own Risk" Disclaimer + +All information in this Service is provided "as is", with no guarantee of completeness, accuracy, timeliness or of the results obtained from the use of this information, and without warranty of any kind, express or implied, including, but not limited to warranties of performance, merchantability and fitness for a particular purpose. + +The Company will not be liable to you or anyone else for any decision made or action taken in reliance on the information in this Service or for any consequential, special or similar damages, even if advised of the possibility of such damages. + +# Contact Us + +If you have any questions about this Disclaimer, You can contact Us: + +* By visiting this page: [https://github.com/ayltai/BrewMyMac/issues](https://github.com/ayltai/BrewMyMac/issues). diff --git a/public/data/privacy.md b/public/data/privacy.md new file mode 100644 index 0000000..f9381bf --- /dev/null +++ b/public/data/privacy.md @@ -0,0 +1,153 @@ +Last updated: September 15, 2022 + +This privacy notice for BrewMyMac ("**Company**", "**we**", "**us**", or "**our**"), describes how and why we might collect, store, use, and/or share ("**process**") your information when you use our services ("**Service**"), such as when you: + +* Visit our website at [https://brewmymac.com](https://brewmymac.com/), or any website of ours that links to this privacy notice (collectively, "**Website**"). +* Engage with us in other related ways, including any sales, marketing, or events. + +This privacy notice also describes your rights and choices regarding your information. + +# Summary of key points + +* **What personal information do we process?** When you visit, use, or navigate our Services, we may process personal information depending on how you interact with BrewMyMac and the Services, the choices you make, and the products and features you use. +* **Do we process any sensitive personal information?** We do not process any sensitive personal information. +* **Do we receive any information from third parties?** We do not receive any information from third parties. +* **How do we process your information?** We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and ot comply with law. We may also process your information for other purposes with your consent. We process your information only when we have a valid legal reason to do so. +* **In what situations and with which parties do we share personal information?** We may share information in specific situations and with specific third parties. +* **What are your rights?** Depending on where you are located geographically, the applicable privacy law may mean you have certain rights regarding your personal information. +* **How do you exercise your rights?** The easiest way to exercise your rights is by contacting us. We will consider and act upon any request in accordance with applicable data protection laws. + +# What information do we collect? + +## Personal information you disclose to us + +*In short*: We collect personal information that you provide to us. + +We collect personal information that you voluntarily provide to us when you express an interest in obtaining information about us or our products and Services, when you participate in activities on the Services, or otherwise when you contact us. + +All personal information that you provide to us must be true, complete, and accurate, and you must notify us of any changes to such personal information. + +## Sensitive information + +We do not process sensitive information + +## Information automatically collected + +*In short*: Some information — such as your Internet Protocol (IP) address and/or browser and device characteristics — is collected automatically when you visit our Services. + +We automatically collect certain information when you visit, use, or navigate the Services. This information does not reveal your specific identity (like your name or contact information) but may include device and usage information, such as your IP address, browser and device characteristics, operating system, language preferences, referring URLs, device name, country, location, information about how and when you use our Services and other technical information. This information is primarily needed to maintain the security and operation of our Services, and for our internal analytics and reporting purposes. + +The information we collect includes: + +* *Log and Usage Data*: Log and usage data is service-related, diagnostic, usage and performance information our servers automatically collect when you access or use our Services and which we record in log files. Depending on how you interact with us, this log data may include your IP address, device information, browser type and settings and information about your activity in the Services (such as the date/time stamps associated with your usage, pages and files viewed, searches and other actions you take such as which features you use), device event information (such as system activity, error reports (sometimes called 'crash dumps') and hardware settings). +* *Device Data*: We collect device data such as information about your computer, phone, tablet or other device you use to access the Services. Depending on the device used, this device data may include information such as your IP address (or proxy server), device and application identification numbers, location, browser type, hardware model Internet service provider and/or mobile carrier, operating system and system configuration information. +* *Location Data*: We collect location data such as information about your device's location, which can be either precise or imprecise. How much information we collect depends on the type and settings of the device you use to access the Services. For example, we may use GPS and other technologies to collect geolocation data that tells us your current location (based on your IP address). You can opt out of allowing us to collect this information either by refusing access to the information or by disabling your Location setting on your device. Note however, if you choose to opt out, you may not be able to use certain aspects of the Services. + +# How do we process your information? + +*In short*: We process your information for purposes based on legitimate business interests, the fulfillment of our contract with you, compliance with our legal obligations, and/or your consent. + +We process your personal information for a variety of reasons, depending on how you interact with our Services, including: + +* **To request feedback**: We may process your information when necessary to request feedback and to contact you about your use of our Services. +* **To identify usage trends**: We may process information about how you use our Services to better understand how they are being used so we can improve them. +* **To save or protect an individual's vital interest**: We may process your information when necessary to save or protect an individual's vital interest, such as to prevent harm. + +# What legal bases do we rely on to process your information? + +*In short*: We only process your personal information when we believe it is necessary and we have a valid legal reason (i.e., legal basis) to do so under applicable law, like with your consent, to comply with laws, to provide you with services to enter into or fulfill our contractual obligations, to protect your rights, or to fulfill our legitimate business interests. + +*If you are located in the EU or UK, this section applies to you.* + +The General Data Protection Regulation (GDPR) and UK GDPR require us to explain the valid legal bases we rely on in order to process your personal information. As such we may rely on the following legal bases to process your personal information: + +* **Consent**: We may process your personal information if you have given us specific consent to use your personal information for a specific purpose. You can withdraw your consent at any time. +* **Legitimate interests**: We may process your information when we believe it is reasonably necessary to achieve our legitimate business interests and those interests do not outweigh your interests and fundamental rights and freedoms. For example, we may process your personal information for some of the purposes described in order to: + * Analyze how our services are used so we can improve them to engage and retain users. + * Understand how our users use our products and services so we can improve user experience. +* **Legal obligations**: We may process your information where we believe it is necessary for compliance with our legal obligations, such as to cooperate with a law enforcement body or regulatory agency, exercise or defend our legal rights, or disclose your information as evidence in litigation in which we are involved. +* **Vital interests**: We may process your information where we believe it is necessary to protect your vital interests or the vital interests of a third party, such as situations involving potential threats to the safety of any person. + +*If you are located in Canada, this section applies to you.* + +We may process your information if you have given us specific permission (i.e., express consent) to use your personal information for a specific purpose, or in situations where your permission can be inferred (i.e., implied consent). You can withdraw your consent at any time. + +In some exceptional cases, we may be legally permitted under applicable law to process your information without your consent, including, for example: + +* If collection is clearly in the interests of an individual and consent cannot be obtained in a timely way +* For investigations and fraud detection and prevention +* For business transactions provided certain conditions are met +* If it is contained in a witness statement and the collection is necessary to assess, process, or settle an insurance claim +* For identifying injured, ill, or deceased persons and communicating with next of kin +* If we have reasonable grounds to believe an individual has been, is, or may be victim of financial abuse +* If it is reasonable to expect collection and use with consent would compromise the availability or the accuracy of the information and the collection is reasonable for purposes related to investigating a breach of an agreement or a contravention of the laws of Canada or a province +* If disclosure is required to comply with a subpoena, warrant, court order, or rules of the court relating to the production of records +* If it was produced by an individual in the course of their employment, business, or profession and the collection is consistent with the purposes for which the information was produced +* If the collection is solely for journalistic, artistic, or literary purposes +* If the information is publicly available and is specified by the regulations + +# When and with whom do we share your personal information? + +*In short*: We may share information in specific situations described in this section. + +We may need to share your personal information in the following situation(s): + +* **Business transfers**: We may share or transfer your information in connection with, or during negotiations of, any merger, sale of company assets, financing, or acquisition of all or a portion of our business to another company. + +# How long do we keep your information? + +*In short*: We keep your information for as long as necessary to fulfill the purposes outlined in this privacy notice unless otherwise required by law. + +We will only keep your personal information for as long as it is necessary for the purposes set out in this privacy notice, unless a longer retention period is required or permitted by law (such as tax, accounting, or other legal requirements). + +When we have no ongoing legitimate business need to process your personal information, we will either delete or anonymize such information, or, if this is not possible (for example, because your personal information has been stored in backup archives), then we will securely store your personal information and isolate it from any further processing until deletion is possible. + +# Do we collection information from minors? + +*In short*: We do not knowingly collect data from or market to children under 18 years of age. + +We do not knowingly solicit data from or market to children under 18 years of age. By using the Services, you represent that you are at least 18 or that you are the parent or guardian of such a minor and consent to such minor dependent’s use of the Services. If we learn that personal information from users less than 18 years of age has been collected, we will deactivate the account and take reasonable measures to promptly delete such data from our records. If you become aware of any data we may have collected from children under age 18, please contact us at [alantai@duck.com](mailto:alantai@duck.com). + +# What are your privacy rights? + +*In short*: In some regions, such as the European Economic Area (EEA), United Kingdom (UK), and Canada, you have rights that allow you greater access to and control over your personal information. You may review, change, or terminate your account at any time. + +In some regions (like the EEA, UK, and Canada), you have certain rights under applicable data protection laws. These may include the right (i) to request access and obtain a copy of your personal information, (ii) to request rectification or erasure; (iii) to restrict the processing of your personal information; and (iv) if applicable, to data portability. In certain circumstances, you may also have the right to object to the processing of your personal information. You can make such a request by contacting us by using the contact details provided in the section below. + +We will consider and act upon any request in accordance with applicable data protection laws. + +If you are located in the EEA or UK and you believe we are unlawfully processing your personal information, you also have the right to complain to your local data protection supervisory authority. You can find their contact details here: [http://ec.europa.eu/justice/data-protection/bodies/authorities/index_en.htm](http://ec.europa.eu/justice/data-protection/bodies/authorities/index_en.htm). + +If you are located in Switzerland, the contact details for the data protection authorities are available here: [https://www.edoeb.admin.ch/edoeb/en/home.html](https://www.edoeb.admin.ch/edoeb/en/home.html). + +**Withdrawing your consent**: If we are relying on your consent to process your personal information, which may be express and/or implied consent depending on the applicable law, you have the right to withdraw your consent at any time. You can withdraw your consent at any time by contacting us by using the contact details provided in the section below. + +However, please note that this will not affect the lawfulness of the processing before its withdrawal nor, when applicable law allows, will it affect the processing of your personal information conducted in reliance on lawful processing grounds other than consent. + +If you have questions or comments about your privacy rights, you may email us at [alantai@duck.com](mailto:alantai@duck.com). + +# Controls for do-not-track features + +Most web browsers and some mobile operating systems and mobile applications include a Do-Not-Track (“DNT”) feature or setting you can activate to signal your privacy preference not to have data about your online browsing activities monitored and collected. No uniform technology standard for recognizing and implementing DNT signals has been finalized. As such, we do not currently respond to DNT browser signals or any other mechanism that automatically communicates your choice not to be tracked online. If a standard for online tracking is adopted that we must follow in the future, we will inform you about that practice in a revised version of this privacy notice. + +# Do California residents have specific privacy rights? + +*In short*: Yes, if you are a resident of California, you are granted specific rights regarding access to your personal information. + +California Civil Code Section 1798.83, also known as the “Shine The Light” law, permits our users who are California residents to request and obtain from us, once a year and free of charge, information about categories of personal information (if any) we disclosed to third parties for direct marketing purposes and the names and addresses of all third parties with which we shared personal information in the immediately preceding calendar year. If you are a California resident and would like to make such a request, please submit your request in writing to us using the contact information provided below. + +If you are under 18 years of age, reside in California, and have a registered account with the Services, you have the right to request removal of unwanted data that you publicly post on the Services. To request removal of such data, please contact us using the contact information provided below, and include the email address associated with your account and a statement that you reside in California. We will make sure the data is not publicly displayed on the Services, but please be aware that the data may not be completely or comprehensively removed from our systems. + +# Do we make updates to this notice? + +*In short*: Yes, we will update this notice as necessary to stay compliant with relevant laws. + +We may update this privacy notice from time to time. The updated version will be indicated by an updated “Revised” date and the updated version will be effective as soon as it is accessible. If we make material changes to this privacy notice, we may notify you either by prominently posting a notice of such changes or by directly sending you a notification. We encourage you to review this privacy notice frequently to be informed of how we are protecting your information. + +# How can you contact us about this notice? + +If you have questions or comments about this notice, you may email us at [alantai@duck.com](mailto:alantai@duck.com). + +# How can you review, update, or delete the data we collect from you? + +Based on the applicable laws of your country, you may have the right to request access to the personal information we collect from you, change that information, or delete it in some circumstances. To request to review, update, or delete your personal information, please submit a request by contacting us. We will respond to your request within 30 days. diff --git a/public/data/terms.md b/public/data/terms.md new file mode 100644 index 0000000..270bf83 --- /dev/null +++ b/public/data/terms.md @@ -0,0 +1,107 @@ +Last updated: September 15, 2022 +

+Please read these terms and conditions carefully before using Our Service. + +# Interpretation and Definitions + +## Interpretation + +The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural. + +## Definitions + +For the purposes of these Terms and Conditions: + +* **Affiliate** means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority. +* **Country** refers to: United Kingdom +* **Company** (referred to as either "the Company", "We", "Us" or "Our" in this Agreement) refers to BrewMyMac. +* **Device** means any device that can access the Service such as a computer, a cellphone or a digital tablet. +* **Service** refers to the Website. +* **Terms and Conditions** (also referred as "Terms") mean these Terms and Conditions that form the entire agreement between You and the Company regarding the use of the Service. +* **Third-party Social Media Service** means any services or content (including data, information, products or services) provided by a third-party that may be displayed, included or made available by the Service. +* **Website** refers to BrewMyMac, accessible from [https://brewmymac.com](https://brewmymac.com) +* **You** means the individual accessing or using the Service, or the company, or other legal entity on behalf of which such individual is accessing or using the Service, as applicable. + +# Acknowledgement + +These are the Terms and Conditions governing the use of this Service and the agreement that operates between You and the Company. These Terms and Conditions set out the rights and obligations of all users regarding the use of the Service. + +Your access to and use of the Service is conditioned on Your acceptance of and compliance with these Terms and Conditions. These Terms and Conditions apply to all visitors, users and others who access or use the Service. + +By accessing or using the Service You agree to be bound by these Terms and Conditions. If You disagree with any part of these Terms and Conditions then You may not access the Service. + +You represent that you are over the age of 18. The Company does not permit those under 18 to use the Service. + +Your access to and use of the Service is also conditioned on Your acceptance of and compliance with the Privacy Policy of the Company. Our Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your personal information when You use the Application or the Website and tells You about Your privacy rights and how the law protects You. Please read Our Privacy Policy carefully before using Our Service. + +# Links to Other Websites + +Our Service may contain links to third-party web sites or services that are not owned or controlled by the Company. + +The Company has no control over, and assumes no responsibility for, the content, privacy policies, or practices of any third party web sites or services. You further acknowledge and agree that the Company shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such web sites or services. + +We strongly advise You to read the terms and conditions and privacy policies of any third-party web sites or services that You visit. + +# Termination + +We may terminate or suspend Your access immediately, without prior notice or liability, for any reason whatsoever, including without limitation if You breach these Terms and Conditions. + +Upon termination, Your right to use the Service will cease immediately. + +# Limitation of Liability + +Notwithstanding any damages that You might incur, the entire liability of the Company and any of its suppliers under any provision of this Terms and Your exclusive remedy for all of the foregoing shall be limited to the amount actually paid by You through the Service or 100 USD if You haven't purchased anything through the Service. + +To the maximum extent permitted by applicable law, in no event shall the Company or its suppliers be liable for any special, incidental, indirect, or consequential damages whatsoever (including, but not limited to, damages for loss of profits, loss of data or other information, for business interruption, for personal injury, loss of privacy arising out of or in any way related to the use of or inability to use the Service, third-party software and/or third-party hardware used with the Service, or otherwise in connection with any provision of this Terms), even if the Company or any supplier has been advised of the possibility of such damages and even if the remedy fails of its essential purpose. + +Some states do not allow the exclusion of implied warranties or limitation of liability for incidental or consequential damages, which means that some of the above limitations may not apply. In these states, each party's liability will be limited to the greatest extent permitted by law. + +# "AS IS" and "AS AVAILABLE" Disclaimer + +The Service is provided to You "AS IS" and "AS AVAILABLE" and with all faults and defects without warranty of any kind. To the maximum extent permitted under applicable law, the Company, on its own behalf and on behalf of its Affiliates and its and their respective licensors and service providers, expressly disclaims all warranties, whether express, implied, statutory or otherwise, with respect to the Service, including all implied warranties of merchantability, fitness for a particular purpose, title and non-infringement, and warranties that may arise out of course of dealing, course of performance, usage or trade practice. Without limitation to the foregoing, the Company provides no warranty or undertaking, and makes no representation of any kind that the Service will meet Your requirements, achieve any intended results, be compatible or work with any other software, applications, systems or services, operate without interruption, meet any performance or reliability standards or be error free or that any errors or defects can or will be corrected. + +Without limiting the foregoing, neither the Company nor any of the company's provider makes any representation or warranty of any kind, express or implied: (i) as to the operation or availability of the Service, or the information, content, and materials or products included thereon; (ii) that the Service will be uninterrupted or error-free; (iii) as to the accuracy, reliability, or currency of any information or content provided through the Service; or (iv) that the Service, its servers, the content, or e-mails sent from or on behalf of the Company are free of viruses, scripts, trojan horses, worms, malware, timebombs or other harmful components. + +Some jurisdictions do not allow the exclusion of certain types of warranties or limitations on applicable statutory rights of a consumer, so some or all of the above exclusions and limitations may not apply to You. But in such a case the exclusions and limitations set forth in this section shall be applied to the greatest extent enforceable under applicable law. + +# Governing Law + +The laws of the Country, excluding its conflicts of law rules, shall govern this Terms and Your use of the Service. Your use of the Service may also be subject to other local, state, national, or international laws. + +# Disputes Resolution + +If You have any concern or dispute about the Service, You agree to first try to resolve the dispute informally by contacting the Company. + +# For European Union (EU) Users + +If You are a European Union consumer, you will benefit from any mandatory provisions of the law of the country in which you are resident in. + +# United States Legal Compliance + +You represent and warrant that (i) You are not located in a country that is subject to the United States government embargo, or that has been designated by the United States government as a "terror + +# Severability and Waiver + +## Severability + +If any provision of these Terms is held to be unenforceable or invalid, such provision will be changed and interpreted to accomplish the objectives of such provision to the greatest extent possible under applicable law and the remaining provisions will continue in full force and effect. + +## Waiver + +Except as provided herein, the failure to exercise a right or to require performance of an obligation under this Terms shall not effect a party's ability to exercise such right or require such performance at any time thereafter nor shall be the waiver of a breach constitute a waiver of any subsequent breach. + +# Translation Interpretation + +These Terms and Conditions may have been translated if We have made them available to You on our Service. + +# Changes to These Terms and Conditions + +We reserve the right, at Our sole discretion, to modify or replace these Terms at any time. If a revision is material We will make reasonable efforts to provide at least 30 days' notice prior to any new terms taking effect. What constitutes a material change will be determined at Our sole discretion. + +By continuing to access or use Our Service after those revisions become effective, You agree to be bound by the revised terms. If You do not agree to the new terms, in whole or in part, please stop using the website and the Service. + +# Contact Us + +If you have any questions about these Terms and Conditions, You can contact us: + +* By visiting this page: [https://github.com/ayltai/BrewMyMac/issues](https://github.com/ayltai/BrewMyMac/issues). diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx new file mode 100644 index 0000000..37f311d --- /dev/null +++ b/src/components/Footer.tsx @@ -0,0 +1,26 @@ +import { Box, Paper, styled, } from '@mui/material'; +import React from 'react'; + +const BottomPaper = styled(Paper)` + width : 100%; + bottom : 0; + position : fixed; + z-index : 1; +`; + +export const Footer = ({ + children, +} : { + children? : React.ReactNode, +}) => ( + + + {children} + + +); diff --git a/src/components/MarkdownDialog.tsx b/src/components/MarkdownDialog.tsx new file mode 100644 index 0000000..ad9587f --- /dev/null +++ b/src/components/MarkdownDialog.tsx @@ -0,0 +1,37 @@ +import Markdown from 'markdown-to-jsx'; +import React, { useEffect, useState, } from 'react'; + +import { handleError, } from '../utils'; + +import { PopUpDialog, } from './PopUpDialog'; + +export const MarkdownDialog = ({ + title, + markdownFilePath, + onClose, +} : { + title : string, + markdownFilePath : string, + onClose? : () => void, +}) => { + const [ content, setContent, ] = useState(''); + + const fetchContent = async () => { + const file = await fetch(markdownFilePath); + + return await file.text(); + }; + + useEffect(() => { + fetchContent().then(setContent).catch(handleError); + }, []); + + return ( + + {content} + + ); +}; diff --git a/src/components/index.ts b/src/components/index.ts index 12045af..d3ce74d 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,8 +1,10 @@ export { ActionBar, } from './ActionBar'; export { CopyableTextField, } from './CopyableTextField'; export { FilteredItemGrid, } from './FilteredItemGrid'; +export { Footer, } from './Footer'; export { ItemList, } from './ItemList'; export { Loading, } from './Loading'; +export { MarkdownDialog, } from './MarkdownDialog'; export { PopUpDialog, } from './PopUpDialog'; export { SearchBox, } from './SearchBox'; export { SelectableItem, } from './SelectableItem'; diff --git a/src/i18n/en.json b/src/i18n/en.json index 92bc82e..b5e8973 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -16,6 +16,9 @@ "label_copy" : "Command copied to clipboard", "label_about_title" : "About BrewMyMac", "label_about_description" : "BrewMyMac is possibly the coolest way to install apps and customize your Mac. You can choose from a wide range of apps and tweaks, and then install them with a single click. This is a much better way than going to each app's website separately and starting all the downloads manually.\n\nBrewMyMac is a free service, and it's an open-source, hobby project made over a weekend by Alan Tai.", + "label_terms_title" : "Terms and Conditions", + "label_privacy_title" : "Privacy Policy", + "label_disclaimer_title" : "Disclaimer", "url_linkedin" : "https://www.linkedin.com/in/ayltai/", "action_learn_more" : "Learn more", "action_customize" : "Customize", diff --git a/src/screens/Disclaimer.test.tsx b/src/screens/Disclaimer.test.tsx new file mode 100644 index 0000000..e208925 --- /dev/null +++ b/src/screens/Disclaimer.test.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +import { render, } from '../utils/test'; + +import { Disclaimer, } from './Disclaimer'; + +describe('', () => { + it('renders correctly', () => expect(render().asFragment()).toMatchSnapshot()); +}); diff --git a/src/screens/Disclaimer.tsx b/src/screens/Disclaimer.tsx new file mode 100644 index 0000000..d910175 --- /dev/null +++ b/src/screens/Disclaimer.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { useTranslation, } from 'react-i18next'; + +import { MarkdownDialog, } from '../components'; + +export const Disclaimer = ({ + onClose, +} : { + onClose? : () => void, +}) => { + const { t, } = useTranslation(); + + return ( + + ); +}; diff --git a/src/screens/Home.tsx b/src/screens/Home.tsx index 02c9de5..5b77478 100644 --- a/src/screens/Home.tsx +++ b/src/screens/Home.tsx @@ -1,16 +1,19 @@ import { InstallDesktop, } from '@mui/icons-material'; -import { Badge, Box, Grid, IconButton, styled, ToggleButton, Tooltip, } from '@mui/material'; +import { Badge, Box, Grid, IconButton, Link, styled, ToggleButton, Tooltip, } from '@mui/material'; import { render, } from 'ejs'; import { useGA4React, } from 'ga-4-react'; import React, { useEffect, useState, } from 'react'; import { useTranslation, } from 'react-i18next'; import { v4, } from 'uuid'; -import { ActionBar, FilteredItemGrid, Loading, SearchBox, } from '../components'; +import { ActionBar, FilteredItemGrid, Footer, Loading, SearchBox, } from '../components'; import { useAppSelector, } from '../hooks'; import type { Session, } from '../models'; +import { Disclaimer, } from './Disclaimer'; +import { Privacy, } from './Privacy'; import { SessionDetail, } from './SessionDetail'; +import { Terms, } from './Terms'; const FlexBox = styled(Box)` height : 100%; @@ -18,6 +21,10 @@ const FlexBox = styled(Box)` flex-direction : column; `; +const ClickableLink = styled(Link)` + cursor : pointer; +`; + const RightAlignedToggleButton = styled(ToggleButton)(({ theme, }) => ({ marginLeft : theme.spacing(2), float : 'right', @@ -37,6 +44,9 @@ export const Home = () => { const [ showSelected, setShowSelected, ] = useState(false); const [ savedSession, setSavedSession, ] = useState(); const [ showSessionDetail, setShowSessionDetail, ] = useState(false); + const [ showTerms, setShowTerms, ] = useState(false); + const [ showPrivacy, setShowPrivacy, ] = useState(false); + const [ showDisclaimer, setShowDisclaimer, ] = useState(false); const { t, } = useTranslation(); @@ -76,63 +86,91 @@ export const Home = () => { setSavedSession(undefined); }; + const handleShowTerms = () => setShowTerms(true); + + const handleShowPrivacy = () => setShowPrivacy(true); + + const handleShowDisclaimer = () => setShowDisclaimer(true); + + const handleCloseTerms = () => setShowTerms(false); + + const handleClosePrivacy = () => setShowPrivacy(false); + + const handleCloseDisclaimer = () => setShowDisclaimer(false); + useEffect(() => { if (ga) ga.pageview('/'); }, [ ga, ]); return ( - - - } - rightComponent={ - <> - - - - {session.items.length > 0 && ( - - - - )} - {session.items.length === 0 && } - - - - - {t('label_show_selected')} - - - } /> - - - - {showSessionDetail && savedSession && ( - - )} - {showSessionDetail && !savedSession && } - + <> +
+ + {t('label_terms_title')} + + + {t('label_privacy_title')} + + + {t('label_disclaimer_title')} + +
+ + + } + rightComponent={ + <> + + + + {session.items.length > 0 && ( + + + + )} + {session.items.length === 0 && } + + + + + {t('label_show_selected')} + + + } /> + + + + {showSessionDetail && savedSession && ( + + )} + {showSessionDetail && !savedSession && } + {showTerms && } + {showPrivacy && } + {showDisclaimer && } + + ); }; diff --git a/src/screens/Privacy.test.tsx b/src/screens/Privacy.test.tsx new file mode 100644 index 0000000..ea651b5 --- /dev/null +++ b/src/screens/Privacy.test.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +import { render, } from '../utils/test'; + +import { Privacy, } from './Privacy'; + +describe('', () => { + it('renders correctly', () => expect(render().asFragment()).toMatchSnapshot()); +}); diff --git a/src/screens/Privacy.tsx b/src/screens/Privacy.tsx new file mode 100644 index 0000000..d683aa5 --- /dev/null +++ b/src/screens/Privacy.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { useTranslation, } from 'react-i18next'; + +import { MarkdownDialog, } from '../components'; + +export const Privacy = ({ + onClose, +} : { + onClose? : () => void, +}) => { + const { t, } = useTranslation(); + + return ( + + ); +}; diff --git a/src/screens/Terms.test.tsx b/src/screens/Terms.test.tsx new file mode 100644 index 0000000..6db766c --- /dev/null +++ b/src/screens/Terms.test.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +import { render, } from '../utils/test'; + +import { Terms, } from './Terms'; + +describe('', () => { + it('renders correctly', () => expect(render().asFragment()).toMatchSnapshot()); +}); diff --git a/src/screens/Terms.tsx b/src/screens/Terms.tsx new file mode 100644 index 0000000..8582153 --- /dev/null +++ b/src/screens/Terms.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { useTranslation, } from 'react-i18next'; + +import { MarkdownDialog, } from '../components'; + +export const Terms = ({ + onClose, +} : { + onClose? : () => void, +}) => { + const { t, } = useTranslation(); + + return ( + + ); +}; diff --git a/src/screens/__snapshots__/Disclaimer.test.tsx.snap b/src/screens/__snapshots__/Disclaimer.test.tsx.snap new file mode 100644 index 0000000..5b8675f --- /dev/null +++ b/src/screens/__snapshots__/Disclaimer.test.tsx.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` renders correctly 1`] = ``; diff --git a/src/screens/__snapshots__/Home.test.tsx.snap b/src/screens/__snapshots__/Home.test.tsx.snap index 5d52471..722ab94 100644 --- a/src/screens/__snapshots__/Home.test.tsx.snap +++ b/src/screens/__snapshots__/Home.test.tsx.snap @@ -2,6 +2,41 @@ exports[` renders correctly 1`] = ` +
diff --git a/src/screens/__snapshots__/Privacy.test.tsx.snap b/src/screens/__snapshots__/Privacy.test.tsx.snap new file mode 100644 index 0000000..65de7ac --- /dev/null +++ b/src/screens/__snapshots__/Privacy.test.tsx.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` renders correctly 1`] = ``; diff --git a/src/screens/__snapshots__/Terms.test.tsx.snap b/src/screens/__snapshots__/Terms.test.tsx.snap new file mode 100644 index 0000000..6d7daf3 --- /dev/null +++ b/src/screens/__snapshots__/Terms.test.tsx.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` renders correctly 1`] = ``;