The legislation will also limit social media notifications to teens’ phones overnight.