This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "pw-react-landpage", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"@testing-library/jest-dom": "^5.16.5", | |
"@testing-library/react": "^13.4.0", | |
"@testing-library/user-event": "^13.5.0", | |
"@types/validator": "^13.7.10", | |
"antd": "^4.24.1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var restify = require('restify'); //Restify is the server that the backend. | |
var server = restify.createServer(); | |
var corsMiddleware = require('restify-cors-middleware'); | |
var request = require('request'); | |
function subscribe(req, res, next) { | |
var email = req.body.email; // We are grabbing the email. | |
var dataCenter = 'Mailchimp_DATA_CENTER'; | |
var apiKey = 'Mailchimp_API_KEY'; | |
var listID = 'Mailchimp_list_ID'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const handleDeleteUser = async (id) => { | |
try { | |
const data = await deleteUser(`/user/delete/${id}`); | |
handleDeleteResponse(data); | |
} catch(error) { | |
handleDeleteResponse(error); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Pretend delete() is a function that returns a Promise | |
const handleDeleteUser = id => { | |
try { | |
deleteUser(`/user/delete/${id}`).then(data => { | |
handleDeleteResponse(data); | |
}).catch(error => { | |
handleDeleteResponse(error); | |
}); | |
} catch (error) { | |
handleDeleteResponse(error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentWillReceiveProps (newProps) { | |
/* | |
If the new prop (nextProps) is not equal to | |
the current prop, call a function that sets the state | |
*/ | |
const { id } = this.props; | |
if (newProps.id !== id) { | |
//Call some function | |
deleteItem(id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#navigation ul li a').each(function(event){ | |
var mylink = $(this).attr("href"); | |
var url = window.location; | |
//If there is a match, apply a class of current, otherwise, remove the class of current | |
if(url == mylink){ | |
$(this).addClass('current'); | |
}else{ | |
$(this).removeClass('current'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Initialize errors variable and array | |
$errors = array(); | |
$jsonError = ""; | |
//Initialize post values and clean data | |
if(isset($_POST['userName'])){$name = trim(strip_tags(addslashes($_POST['userName'])));} | |
if(isset($_POST['email'])){$email = trim(strip_tags(addslashes($_POST['email'])));} | |
if(isset($_POST['subject'])){$subject = trim(strip_tags(addslashes($_POST['subject'])));} | |
if(isset($_POST['message'])){$message = trim(strip_tags(addslashes($_POST['message'])));} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
//Ajax form validation | |
$("#ajax-form").submit(function() { | |
var formData = $(this).serialize(); | |
$.ajax({ | |
type: "POST", | |
url: "ajax-form.php", | |
data: formData, | |
dataType: 'json', | |
cache: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*{margin:0;padding:0;} | |
body{ | |
background:#A4A4A4; | |
color:#FFF; | |
font: normal 20px/1.5em 'Ubuntu Condensed';} | |
/*Contact Form*/ | |
#ajax-form{margin-top:25px;} | |
#ajax-form > input{ | |
border:0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "main.css"; |
NewerOlder